Вы делали git add .
до совершения?
Всегда разумно сделать git status
перед git add
или git commit
, чтобы посмотреть, что также изменилось и организовано.
Также очень удобно сделать git diff
, чтобы увидеть конкретные изменения, которые вы собираетесь совершить.
Вот что показывает git status
, если вы добавили файл и затем переименовали его.
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
На данный момент вы можете просто сделать git add .
, а затем 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`
В будущем, если у вас есть файлы в git-репо, которые вы хотите переместить, вы должны использовать git mv
.