How to stage changes one by one after reviewing in git?

Usually, it is recommended to create a new fix branch from your master and push it back, but sometimes we kind of go lazzy. In those moments, I simply make the changes and add them one by one using the following command.

When working on your code, there are some situations when you might have to push a simple fix or a piece of code. Usually, it is recommended to create a new fix branch from your master and push it back, but sometimes we kind of go lazzy. In those movements, I make the changes and add them one by one using the following command:

git add -p

I believe it’s worth mentioning how I learned about this lovely little helper.

Originally Posted On: Twitter (wesbos)

Subscribe to GIT.WTF!?!

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe