It's like that old saying about democracy: "Git is the worst version-control system, except for all the others."
It's like that old saying about democracy: "Git is the worst version-control system, except for all the others."
I used to use Git Extensions and lately I've been using the one built into IntelliJ's products. It's not as good, but it's available on mac, so my options are limited.
I used to have such anxiety, but not any more. The final piece of desired state was revealed when I found the reflog -- curiously not mentioned in the article nor by any other comment here.
Try
git log --stat --walk-reflogs
in some repo where you've previously renamed some branches, or done 'git commit --amend'. All the transitional state changes are exposed, and can be undone individually.Fill out the toolkit with 'git branch -avv', and 'git status' with its various options, and you'll be ready to recover from almost any local mishap.
What about a git rebase with conflicts that you were doing interactively and is going to squash some of the commits?
In the first scenario I've learned to very carefully tread the golden path: make changes to the conflicting files to bring them to the state you want (I do this manually because it's less mysterious), and then "continue" the operation (usually I do this through the GUI; when I have to use the CLI I have to look it up). What would happen if I tried to commit something in here? Or unstaged and restaged something? Or stashed? Or pulled? Would it stop me from doing those things, or would I end up in some new weird state? I have no idea; I just avoid all anomalies and hope it goes smoothly and I end up back in a good place.