Git似乎跟踪驱动器上的每个文件

时间:2013-11-27 22:56:55

标签: git version-control git-status

出于某种原因,当我设置我的git存储库时,git clone列出了该特定驱动器中的所有文件,即

% git status  # On branch master 
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   deleted:    index.html
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   ../../../-framework dla ASHA
#   ../../../.CFUserTextEncoding
#   ../../../.Trash/
#   ../../../.Xauthority

输出更长,这使得项目管理有点痛苦。

我不知道为什么会发生这种情况,我之前使用过git但是从来没有遇到过这个问题,这让我觉得我错过了一些明显的东西。

1 个答案:

答案 0 :(得分:2)

使用以下命令找出Git认为项目的根目录是什么:

git rev-parse --show-toplevel

鉴于此,你或许可以发现Git为什么会做你所观察到的事情。

同时检查以确保没有为GIT_DIR环境变量设置意外值。