当从特定仓库中的子目录使用 git 时,文件的路径将相对于根目录返回,如下所示
cd $REPO_ROOT/subdir
git status
...
# modified ../subdir/file.txt
这种行为是最近的,它过去常常返回file.txt
,就像我的其他 git repos 一样,它弄乱了其他功能,git blame file.txt
从子目录返回每一行作为Not Yet committed
,以获得我需要使用的实际输出../subdir/file.txt
。这也弄乱了 vim git 插件,所以我很生气。
我已经跑git gc
了,但问题仍然存在。
编辑:添加 git 版本和配置
git version 1.7.4.4
user.name=...
user.email=...
github.user=...
color.branch=auto
color.diff=auto
color.status=auto
color.branch.current=yellow reverse
color.branch.local=yellow
color.branch.remote=green
color.diff.meta=yellow bold
color.diff.frag=magenta bold
color.diff.old=red
color.diff.new=green
color.status.added=green
color.status.changed=red
color.status.untracked=cyan
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
#remotes and branches
status.relativepaths=true