Did you do a git add .
before you committed?
It's always wise to do a git status
before either git add
or git commit
to see what's changed and staged, as well.
It's also very handy to do git diff
to see the specific changes you are about to commit.
Here's what git status
shows if you have added a file and then renamed it.
me@home:~$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: foo.txt
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: foo.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# bar.txt
At this point you can just do git add .
and then git status will give you more information, perhaps pointing out that you still have a new file and a deleted file called
foo.txt. To fix this you need to manually
git rm foo.txt before doing
git commit`
In the future if you have files in a git repo that you want to move you should use git mv
.