How to add only modified files to the stage area

It may happen that your working directory has a mixture of new files and old files that you updated. If you want to issue a git add but ignore the new files momentarily, maybe because you just want to update the old files in your commit, use the following command instead of your regular git add.

git add -u

The above command only looks at changes done to the files that were already being tracked i.e. ones that have been modified or removed and add/removes them to/from the stage.

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *