3 ms·
Rebase is the key. There are two types of commit: checkpoints and versions. Checkpoints are just you randomly deciding to "save" your progress. They don't nec
by globular-toast 5y ago
Rebase is the key.
There are two types of commit: checkpoints and versions.
Checkpoints are just you randomly deciding to "save" your progress. They don't necessarily correspond to completely working versions. The commit messages can be completely inappropriate for sharing but only make sense to you.
Versions are fully working copies of the program that could be checked out, run, released etc. These are what you present to your team and what gets merged in the end.
Sometimes you can write a new version straight away but other times you'll generate checkpoints first. Then you use rebase to get to versions. Use rebase as a way to make it look you are a superhuman writing perfect commits first time.
Getting good at rebasing takes some practice and pretty good understanding of git's data model. Learn this. And learn how to use --fixup, --squash and --autosquash to make your life easier.