我正在尝试使用shell脚本和.gitconfig在使用git扩展文件时打开p4merge(在Mac上)。
它几乎正常工作,但我对“右”文件(第二个文件)的相对路径有问题,该文件传递给p4merge:
~> git diff <absolute path>/django/templates/pagination.html
output:
/<absolute path to prev version>//jtpgjm_pagination.html django/templates/pagination.html
Incorrect parameters: 'django/templates/pagination.html' is (or points to) an invalid file.
正在第一个参数上展开完整路径,但在第二个参数上不展开。我可以做些什么来触发第二个文件的完整文件路径吗?
答案 0 :(得分:0)
使用此:
readlink -f django/templates/pagination.html
作为命令的参数,例如:
echo $(readlink -f django/templates/pagination.html)