在运行
git add .
后,我为什么会在Changes not staged for commit
中找到项目?> git add .
> git st
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: bin/ls-- (modified content, untracked content)
#
这是在Red Hat 4.1.2-50
上,使用了git 1.7.10
。
git add bin
,它是否起作用? - William Seiti Mizutagit add bin
,但它仍然报告在“更改未提交”中的条目。 - Amelio Vazquez-Reinagit add .
确实添加了文件,但在你的git st
之前,该文件又以某种方式被修改了。我假设git st
是git status <some flags>
的别名或类似的东西。尽管当我测试这种情况时,我得到的是将文件列在两个不同的部分中,而不是你展示的(modified content, untracked content)
指示器 - 不确定是否旧版本的git
可能会以那种方式报告它... - twalbergbin
或不使用),但我仍然得到相同的提示信息 "Changes not staged for commit"。非常奇怪。 - Amelio Vazquez-Reina