我做了一个git commit -m "message",像这样:

> git commit -m "save arezzo files"
# On branch master
# 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)
#
#       modified:   arezzo.txt
#       modified:   arezzo.jsp
#
no changes added to commit (use "git add" and/or "git commit -a")

但是之后,当我做git状态时,它显示了相同的修改文件:

> git status
# On branch master
# 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)
#
#       modified:   arezzo.txt
#       modified:   arezzo.jsp
#
no changes added to commit (use "git add" and/or "git commit -a")

我做错了什么?


当前回答

我有一个问题,我在做提交-修改后,甚至发布了一个git添加。但它还是不能工作。原来我做了一些.vimrc自定义,我的编辑器不能正常工作。修复这些错误以使vim返回正确的代码就解决了这个问题。

其他回答

你应该:

git commit . -m "save arezzo files"

我有一个问题,我在做提交-修改后,甚至发布了一个git添加。但它还是不能工作。原来我做了一些.vimrc自定义,我的编辑器不能正常工作。修复这些错误以使vim返回正确的代码就解决了这个问题。

如果你有一个子文件夹,它是从其他git-Repository中克隆出来的,首先你必须删除$。get $ file from child-Repository Rm -rf .git 然后你可以切换到父文件夹,使用git add -A。

我有一个非常类似的问题,同样的错误消息。“更改没有为提交而上演”,然而当我做diff时,它显示了差异。我终于发现,之前我改变了一个目录大小写。前女友。“postgresql”改为“postgresql”。我记得有时候git会在旧的case目录下留下一两个文件。然后您将向新案例提交一个新版本。

因此git不知道该依赖哪一个。所以为了解决这个问题,我不得不登陆github的网站。然后你就可以看到两种情况了。并且必须删除不正确的套管器目录中的所有文件。确保保存了正确的版本或在正确的大小写目录中。

删除旧case目录中的所有文件后,整个目录将消失。然后进行提交。

此时,您应该能够在本地计算机上执行Pull操作,并且不再看到冲突。因此能够再次承诺。:)

我把Git源代码控制下的一个子项目复制到另一个项目中,忘记删除. Git文件夹。当我去提交时,我得到了与上面相同的消息,直到我删除了。git文件夹才能清除它。

这有点傻,但值得检查一下你的文件夹下是否有一个不能提交的。git文件夹。