4) git stash
It lets you make different code changes to fix a bug without creating many local branches.
You can save uncommitted changes in the stash and apply them later.
2) git add -i
It lets you stage only the lines of code that you want.
Also it allows you to squash and remove commits.
Besides avoid "git add ." like the plague because you don't want to break the deployment with unwanted code.
@systemdesign42
I have been using git for the last 7 years. Never even heard of git add -i. Tried it. I donโt know how I went this long without it. Thanks!