A good command, which I should have learned when starting with Git, is the partial commit using git add -p <file>. This lets you decide which part of a file you want to add to the next commit. The following dialog lets you decide what to do with the given chunks: y yes - add it, n no - dont add it, s split the current part into smaller parts.
Very handy at the beginning when you change a lot of stuff, and need to create proper commit messages afterwards.
git add -p <file>
PS: I published a Git Cheat Sheet with the most common Git commands → pixelbrackets.github.io/git_cheat_...
yep literally only learnt this the other day, so useful 👌🏾
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.