I often have a situation where I have git added a set of files for a commit, but then have to make a modification to those files so end up with the modifications on those same files in Changed but not updated.
Is there a one liner I can execute to git add only the files that exist in Changed but not updated and Changes to be committed lists?
markdsievers$git status
# On branch master
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: src/com/foo/Bar.java
# modified: src/com/foo/Foo.java
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: src/com/foo/Bar.java
# modified: src/com/foo/Foo.java
# modified: src/com/foobar/FooBar.java
For the above example I only want Foo.java and Bar.java but not FooBar.java added to the Changes to be committed: list.
This is one way: