Git commits should be very deliberate, and only contain changes that you really want to be in there. In order to reduce the chance to accidentally commit something you didn't intend, review your changes before committing.
git add -N . # Add all paths, but not their contents
git add -p
Git will now show you all your changes in small chunks and ask you in an interactive mode whether you really want to add them.
The most helpful commands are
Note: Sometimes you add a hunk accidentally. With git reset -p
you can unstage hunks easily.
Speedup: How to stage hunks with a single key press
tig status
Will show you all changed files (tracked and untracked).
u
,Enter
and navigating in them with j
(down) and k
(up)u
1
\