问题描述
git status -uno
的示例:
实际行为(相关路径):
new file: xxx/xxx.c
想要的行为(绝对路径):
new file: /home/zzz/xxx/xxx.c
解决方法
我认为您无法让 git status
显示绝对路径,但您可以将其配置为显示相对于 git root 的路径,详情请参阅 man git-status
:
如果配置变量 status.relativePaths
设置为 false
,则显示的所有路径都相对于存储库根目录,而不是当前目录。
~repo/src $ git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
a.txt
和
~repo/src $ git config --global status.relativePaths false
~repo/src $ git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/a.txt