我做了一个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 commit . -m "save arezzo files"

其他回答

你应该:

git commit . -m "save arezzo files"

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

你可以这样做:

git add -u -n

要检查哪些文件已修改并将被添加(预演:-n选项),然后

git add -u

添加修改过的文件

删除所有项目中的每个.git文件

您可以使用该命令

rm -rf .git

我发现这个问题出现时,我已经做了一个git添加。在下面我的.gitignore文件所在的子目录中(可以说是我的存储库的主目录)。尝试将目录更改到最上面的目录并运行git add。后面跟着git commit -m“我的提交消息”。