3 ms·
For me it's the enormous number of (mostly hidden) states that a local repository can be in. That's what gives me anxiety as soon as I go off the golden path: y
by brundolf 6y ago
For me it's the enormous number of (mostly hidden) states that a local repository can be in. That's what gives me anxiety as soon as I go off the golden path: you have to keep a running mental model of where exactly you are (what state the repo is in) in any given ongoing process, and if you don't do the right thing as the next step, you can get into an even worse and more obscure state that you then have to chart your way out of (mostly blindly).
It's like that old saying about democracy: "Git is the worst version-control system, except for all the others."
- t-writescode 6y agoHave you looked at using a good gui for the repository? I find that helps a lot with the mess. 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.
- jmchuster 6y agoFor git on mac, i've found https://www.git-tower.com/ https://www.git-tower.com/ to be ridiculously good. Now that i primarily work on linux, i've settled for Sublime Merge, which has customizable actions, but isn't as intuitive a match for how i want scm to work, like Tower was.
- TheRealDunkirk 6y agoI pay for this out of my own pocket without hesitation. They allow you to use your license on 2 different machines. I do most of my work on my personal Mac, but also keep Tower on my work laptop, so I can do the things I need to do there. I briefly tried Fork, but went back to Tower (and Kaleidosope.) You can pry Sublime Text out of my cold, dead hands, but I find Merge to be confusing.
- brundolf 6y agoYeah, I usually use a GUI. I used SourceTree for a long time but it's gone downhill in recent years. VSCode's integration is great for simple stuff, but it's fairly limited. I haven't found one that I'm happy with across the board.
- crossroadsguy 6y agoGit would unbearable if I hadn’t started using it as a cli+gui combo.
- selfhoster11 6y agoPersonally I love using `git gui` for picking and choosing what goes into my commits line by line. Git command line is plenty powerful, but a dash of GUI here and there does sometimes do wonders for precision and visualisation.
- everybodyknows 6y ago>anxiety as soon as I go off the golden path 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.
- brundolf 6y agoWhat about a git merge with conflicts? 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.