

It is simply not my experience that cleaning up commits after committing early is difficult in git. Amending a commit is a single -a
flag away from the git commit
command. The opposite problem is when you do too much work and want to split it into multiple commit rather than a huge one, in which case git add -p
is again a single flag away from git add
.
In general, git’s entire model is to allow you to work first, and do administrative tasks (including tidying up your commit history etc) later.
And almost nothing is truly destructive in git, the vast majority of cases can be fixed by judicious use of git reflog
.
The only cases I’ve ran into where git repos became corrupted were caused by external tools, mainly GUIs that label buttons with git commands that do something different when clicked (like the button labeled push
actually doing git push —all
for no good reason, and such things) with users that have no idea how git works that have been trained just by telling them “click this to save your work, click this to get the last version of the code”
Fair, git’s documentation can definitely be too terse despite being very extensive and could really benefit from examples and common use cases sections. I only use a fraction of what git offers, but what I do use I use often, which definitely contributes to my happiness with git: I seldomly need to look things up