[英]GIT not tracking files
我在AIX 6.1上设置了GIT并且遇到了问题。
我遵循的步骤顺序如下所示:
执行上述所有步骤并给出git status
命令后,我得到了foll结果:
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ../index.html
# ./
我知道上面目录中的index.html正在显示,但为什么不显示当前目录中的index-2.html。
文件index-2.html也应该被正确跟踪。
输出显示了当前未跟踪的两件事:
../index.html
- 父文件夹中的index.html
文件 ./
- 当前文件夹,包括其所有内容 因此它确实检测到您有一个未跟踪的文件,但由于它对其文件夹一无所知,它只显示该文件夹以累积其所有内容。
如果您添加文件并让Git跟踪它们,它们将正确显示:
git add index-2.html
git add ../index.html
它正在跟踪文件夹./表示当前文件夹。 git没有(如果我错了就纠正我),关心子文件夹。 这意味着如果您的存储库包含文件夹foo,该文件夹已存在于存储库中。 在foo中添加子文件夹栏,并在foo / bar中创建文件foobar.txt。 然后你只会得到:
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ./bar
这意味着如果你在git status命令之前完成了cd ..你会得到:
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# index.html
# newfolder
即使你有一个文件。
原因是git跟踪内容,而不是文件。 由于index2.html实际上是文件夹newfolder的内容,并且您没有跟踪newfolder,因此git不知道index2.html是否存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.