为什么我不能提交? (你的分支是最新的'origin / master',没有改变添加到提交) [英] Why can I not commit? (Your branch is up-to-date with 'origin/master', no changes added to commit)
问题描述
我在向GitHub提交文件时遇到了一些麻烦。我可以把它添加到git中,但是当我尝试 $ git commit -m'my message'
时,我得到一个错误,不允许我完成添加文件。
I have been having some trouble committing a file to GitHub. I can make it to git add, but soon as I try $ git commit -m 'my message'
I get an error, not allowing me to complete the process of adding a file.
$ git add HelloWorld.md
$ git commit -m 'Hello world'
我得到以下答案(删除: README.md
& .DS_Store
显示为红色):
I get the following answer (deleted: README.md
& .DS_Store
are in red):
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
deleted: README.md
Untracked files:
.DS_Store
no changes added to commit
推荐答案
仍然没有提交,也许你没有将文件添加到混帐。 (或者在添加之后替换它)。
在提交前尝试添加文件:
If you changed the file but there is still nothing to commit, maybe you didn't add the file to git. (or replaced it after adding). Try adding the file before committing:
git add filename.ext
或者直接添加整个目录:
Or simply add the whole dir:
git add .
这篇关于为什么我不能提交? (你的分支是最新的'origin / master',没有改变添加到提交)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!