I have a list of changed files in git repository. There is one file I don’t wanna commit for the current moment. Can I do:
git commit -a
To commit all files and then somehow remove that file from current commit? After such removing it should still be in the list of uncommited files.
You want to do this:
Be sure and do this from the top level of the repo;
add -uadds changes in the current directory (recursively).The key line tells git to reset the version of the given path in the index (the staging area for the commit) to the version from HEAD (the currently checked-out commit).
And advance warning of a gotcha for others reading this:
add -ustages all modifications, but doesn’t add untracked files. This is the same as whatcommit -adoes. If you want to add untracked files too, useadd .to recursively add everything.