Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can I not commit? (Your branch is up-to-date with 'origin/master', no changes added to commit)

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'

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
like image 703
imasnake Avatar asked Apr 17 '15 15:04

imasnake


1 Answers

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 .
like image 139
Tom Avatar answered Nov 15 '22 21:11

Tom