我在 git 中遇到问题。我不知道为什么它说“没有什么可提交的(工作目录干净)。”
我的开发环境:CentOS 6.4
我的流程如下:
mkdir 开发
cd 开发
git init(set user.name, user.email)
git remote add origin "repository_name"
git clone "repository_name"
添加“测试”文件夹
(amon2-setup.pl --flavor=基本测试)git status
-> 此时,我可以看到“Untracked files ~~ Test/”cd "Test"
文件夹git status
-> 此时,无需提交(工作目录干净)
为什么这么说?如果我推送“测试”,我的 github 推送数据是“子项目”,所以我看不到测试文件夹的内容。这是为什么?
Linux(坏)
http://www.fastpic.jp/viewer.php?file=6541584337.png
从 Linux 添加 amon 文件(不好,我无法打开文件)
http://www.fastpic.jp/viewer.php?file=4456741517.png
Windows(正常)
http://www.fastpic.jp/images.php?file=8061488422.png
从 Windows 添加 amon 文件(确定)
http://www.fastpic.jp/viewer.php?file=8164112210.png
最佳答案
Test 的灰色文件夹表示:
Test 被添加为一个子模块,这就是为什么父仓库中的 git status 报告必须添加“Test”(它是父仓库索引中的一个 special entry
,它记录了子模块)
一旦进入 Test
(这是一个嵌套的 git repo),因为那个 repo 没有文件,git status 报告一个清晰的索引。
另请注意,Windows 不区分大小写,因此如果已经存在“test
”(小写),“Test
”将无法正确注册
关于linux - "nothing to commit (working directory clean)"添加文件夹时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19130633/