Quick fix. Run:
git add -A :/
git status
Then make sure that only files you want to add/delete/modify have been staged. That's very important. If you've accidentally staged extraneous changes, run git reset
. If you're sure you want to proceed, run git commit
.
Without -A
, git add
only stages file additions and modifications. It will not delete entire files, and moves will turn into copies. git add -A
deletes files that no longer exist.
:/
is a shortcut that means the root of the repository, rather than the current directory. If your current directory is the root of the repository, you can omit this.
Note that running git add -A
--especially in the root of a repository--is generally considered dangerous. Do not get into the habit of blindly committing every change you've made: only stage what you know you want to change. However, when you're moving a large number of files around, this is quite a handy utility.