Skip to content

.tip

· one of the small things

git add -p to commit only the lines that belong together

A file holding both a bug fix and an unrelated rename gives you one bad commit or two lazy ones. Patch mode lets you stage it hunk by hunk.

git add -p
# y stage, n skip, s split the hunk, e edit it by hand

Reviewers get a commit that says one thing, and you get a diff you can revert without losing the other change.

git