Stage hunks in git

Like Pawel I’ve been tethered to source control GUIs because I didn’t know how to stage code hunks in the same file into different commits. But no longer!

The answer is so simple I can’t believe I didn’t search for it earlier.

git add -p name_of_file.txt

How easy is that?