DEV Community

loading...

Discussion on: What is your favourite Git command?

Collapse
pcdevil profile image
Attila Gonda

I am a Terminal user, and I even stage my files from the command line.

The most used and my favourite command is:

git add --patch

With this I can choose what hunk I want to add to the staged status. This is very powerful tool which can be a bit confusing, but just a little bit of practice I really liked when I discovered.

It also helped me to practice TDD because if the dirty file list is huge, it takes too much time to figure out what to add. If you want to do small iterations between commits, this kind of enforces you too!