How to add only modified files to the stage area

It may hap­pen that your work­ing direc­tory has a mix­ture of new files and old files that you updated. If you want to issue a git add but ignore the new files momen­tar­ily, maybe because you just want to update the old files in your com­mit, use the fol­low­ing com­mand instead of your reg­u­lar git add.

git add -u

The above com­mand only looks at changes done to the files that were already being tracked i.e. ones that have been mod­i­fied 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 *