I’ve been using Magit at work because it’s what everyone uses, and it just does useful shit I need to do, like help me revert specific chunks from an old commit, or migrate chunks to a different branch, or whatever. Stuff that I know how to do in Git, but I’m tired and it turns out Magit is just a lot faster and more interactive.
I have a long history of hating Git UIs but somehow Magit is the one exception. I’ve done a lot of surgery on Git repos in the past so I’m no slouch on the command-line, Magit just lets me do it all faster.
I think they key to me is that it is really just helping you write git command lines. The menus are laid out exactly like the options of the relevant git sub-command, so that using Magit makes you more proficient at the CLI and vice versa. Other GUIs (including the awful ones that tend to be built into editors and IDEs) are instead hiding these details from you, so that if you are proficient at git on the CLI, you are still starting nearly from zero with the new interface and vice versa.
Idea: a general tool that helps you write command lines. It reads the help or man page and generates a GUI or TUI to present all the options in a logical way. You just fill out the form and it does the thing
Your comment caught my eye because as the de facto neurosurgeon, I’ve watched way, way too many UIs glitch a coworker into an impossible or unpleasant state and been the only one who didn’t immediately break eye contact. And remember they had someplace else to be. From CVS to SortaSafe to P4 to SVN. By the time I got to svn and saw the same issues I started spending political capital on convincing people to only use the CLI or maybe, maybe, JetBrains.
Usually the upvotes come from the casual users and the muttering from the heavy ones. In light of what I said, would you still recommend magit?
I’ve never met a casual Magit user. They’re usually people who have decided to invest time in learning Emacs or Spacemacs, at the very least. Some of them have massive .emacs files and take notes in org-mode. The casual users would probably be using VS Code or Jetbrains instead.
If anything, Magit has helped me AVOID getting in a bad state, because it automatically shows me more information and context than what I get from the Git command line (despite all this fancy Git stuff I put in my prompt). When I’m committing in Magit, I see some weird hunk I didn’t mean to commit, and I can seamlessly edit it, because I’m already in the editor.
The only downside I've found to magit is that the UI refresh can be slow with very large commits: when you're adding a thousand generated files, doing a big find/replace, etc. In the shell you'd just be running `git status` or `git diff src/foo/` or some such targeted command and would get near-instant results.
The flip side is that I've never seen magit end up in an inconsistent state, which is probably for the same reason it's slow: it's not doing anything "clever," just directly showing you the information it got from git.
I don’t share work details. But everybody on my team uses either Emacs or Spacemacs. There are people at work who use other tools, like VS Code for sure, but Emacs and Spacemacs usage are widespread.
When I say “everyone” uses Magit, I want to clarify that I’m being hyperbolic.
You can get comfortable with it in 5-10min and after that you will slowly discover that it does absolutely everything you could wish for.
Today I'd honestly suggest to skip learning about git altogether (besides the basics, like branching, staging etc) and just start using lazygit immediately.
I've seen people claim that having a clean git commit history is not worth the time, it takes too long to have it nice etc, opting to just stuff their refactor, renaming and new feature changes into one commit. With lazygit I spend a few extra minutes a day to make it nice and I've gotten compliments for it from others when they review my PRs, because it makes the review much easier.
Second this. Put off trying it for years because "why not just use a GUI" if I'm going to leave the console anyway. Turns out lazygit is kind of a happy middle ground and using it actually feels better than it looks.
I really only use lazy git to review my code before commit it and I inevitably his the wrong scroll key and split the windows in half when I didn't mean to and I have to quit and restart to fix it.
That said, you'll pry that app from my cold, dead fingers.
When I was early in my career, I always thought that Git is hard and nerdy, and it is a good thing. I kinda liked it in a way, like there is some gratification in knowing all the commands and helping clueless coworkers, or knowing how to do a rebase -i and shuffle commits around and show off etc.
These days, I find myself just using the smallest subset of commands possible to do my job, and it is enough. Just add, commit, push/pull and occasional stash or merge is like 99.9% of my daily usage. I don't even remember how to revert (was it checkout -- <filename> or reset <filename> or restore <filename>?) and I'm just fine with it.
I think that git is easy. Just learn the happy path, and maybe a way or two for restoring to a known good state without deleting the whole repo, it's enough.
This is a textbook example of damning with faint praise. If your VCS's interface is so bad that it motivates you to scale back your use of any nontrivial version-control features and instead just content yourself with rudimentary file syncing, that's a case against the interface. Either the additional features are useful and you're missing out on that benefit, or they're extraneous and are saddling the tool with unnecessary baggage.
Or, hear me out, the tool has enough features to cover a wider range of use cases than your own. You're not missing the benefit of features outside your use cases.
I believe it was git that finally made me accept that my working memory is actually below average and that I’ve coped basically my entire life by leaning on my chimpanzee-like spatial reasoning and building mind [palace] for everything, especially architectural and network topology conversations (I became the reviewer and copy-editor for the network architect for a project I wasn’t even on because someone knew me better than I did). Graph theory works a treat with this so I become the de facto VCS surgeon. It’s “just” a big, fat, straggly, 4 dimensional tree.
I try not to torture anyone with it (VCS repair) who hasn’t already exhibited a knack for graph theory. I just tell them where the man traps are and to ask if they feel like they need to go there.
I agree people should at least learn the happy path. It really is not hard at all and it solidifies the underlying concepts.
However I find there is a huge difference between me working solo on a repo or with one or two other people versus managing a complex project with 10+ developers and multiple SKUs in the same codebase (as an example).
That's when the "neurosurgery" aspects come in. Problems were frequently caused by junior devs making mistakes in their repo management that could be a headache to untangle (again, as an example).
I agree, but partly for that reason I use fossil for most of my hobby projects. It is less stressful to not have so many features outside of the ones I use, and to not even have to be tempted to rebase or otherwise rewrite history as that is not supported.
For work and all my older hobby projects still only use git and I used that for ages and know it quite well, but that does not mean I always feel like I need to use it instead of something simpler.
(It is also FUN to use some other tool and not just git year after year. Got to learn something new now and then.)
He’s also saying that Magit is so good that he doesn’t recognise the complaints which motivate some people to switch from Git to Jujutsu.
FWIW, I agree. Jujutsu seems fine, but Magit is fine too. Maybe Magit is the Blub of version control, and Jujutsu would change my life for the better, but … I seem to be able to run in circles around my Git-CLI–using colleagues as it is.
I've used it before when I used to use emacs and it's really neat and simple to use but I think lazygit is better. I think of lazygit as the spiritual successor of magit. If you're curious what that looks like you can see a descriptive video on their GitHub.
I really really want a magit version of jujutsu. Apply the same philosophy but use jj commands to achieve it. Under the hood magit still runs git commands so there are still annoyances such as (1) the need to create branches and name them, or (2) having to resolve conflicts as they happen rather then deferring to a more convenient time in the future (first-class conflicts), or (3) the equivalent of `jj evolve` for automatic rebasing.
Also I'll have to say magit simply chose much better names than git. I never understood the `--onto` argument of `git rebase` because it's such a bad name. On the other hand magit calls it rebase subset and it's immediately clear; I now use this kind of rebase almost every day.
Elsewhere in the thread they mentioned that they meant hg evolve. This feature was originally in jj but has been gone for a while, replaced with a simpler concept.
Basically, when you modify a change, jj will automatically rebase all descendants. It’s super useful!
Magit is great, and yeah, the jj team is aware that a lot of people wouldn't switch until there's an equivalent tool.
It's true that there's more to jj than just the stuff magit gives you, but also, people should use the tools they find useful. If you're happy with magit, it's totally reasonable to keep using magit.
Im using magit on windows for years now. It used to be that larger operations would completely clog everything up. They can still be annoying, but it’s not the dealbreaker it used to be.
I’ve been using Magit at work because it’s what everyone uses, and it just does useful shit I need to do, like help me revert specific chunks from an old commit, or migrate chunks to a different branch, or whatever. Stuff that I know how to do in Git, but I’m tired and it turns out Magit is just a lot faster and more interactive.
I have a long history of hating Git UIs but somehow Magit is the one exception. I’ve done a lot of surgery on Git repos in the past so I’m no slouch on the command-line, Magit just lets me do it all faster.
Usually the upvotes come from the casual users and the muttering from the heavy ones. In light of what I said, would you still recommend magit?
If anything, Magit has helped me AVOID getting in a bad state, because it automatically shows me more information and context than what I get from the Git command line (despite all this fancy Git stuff I put in my prompt). When I’m committing in Magit, I see some weird hunk I didn’t mean to commit, and I can seamlessly edit it, because I’m already in the editor.
The flip side is that I've never seen magit end up in an inconsistent state, which is probably for the same reason it's slow: it's not doing anything "clever," just directly showing you the information it got from git.
Where do you work?
When I say “everyone” uses Magit, I want to clarify that I’m being hyperbolic.
https://github.com/jesseduffield/lazygit
I have no connection to this program, other than that I love it, and shill for it every time I get the chance.
Today I'd honestly suggest to skip learning about git altogether (besides the basics, like branching, staging etc) and just start using lazygit immediately.
I've seen people claim that having a clean git commit history is not worth the time, it takes too long to have it nice etc, opting to just stuff their refactor, renaming and new feature changes into one commit. With lazygit I spend a few extra minutes a day to make it nice and I've gotten compliments for it from others when they review my PRs, because it makes the review much easier.
That said, you'll pry that app from my cold, dead fingers.
These days, I find myself just using the smallest subset of commands possible to do my job, and it is enough. Just add, commit, push/pull and occasional stash or merge is like 99.9% of my daily usage. I don't even remember how to revert (was it checkout -- <filename> or reset <filename> or restore <filename>?) and I'm just fine with it.
I think that git is easy. Just learn the happy path, and maybe a way or two for restoring to a known good state without deleting the whole repo, it's enough.
I try not to torture anyone with it (VCS repair) who hasn’t already exhibited a knack for graph theory. I just tell them where the man traps are and to ask if they feel like they need to go there.
However I find there is a huge difference between me working solo on a repo or with one or two other people versus managing a complex project with 10+ developers and multiple SKUs in the same codebase (as an example).
That's when the "neurosurgery" aspects come in. Problems were frequently caused by junior devs making mistakes in their repo management that could be a headache to untangle (again, as an example).
For work and all my older hobby projects still only use git and I used that for ages and know it quite well, but that does not mean I always feel like I need to use it instead of something simpler.
(It is also FUN to use some other tool and not just git year after year. Got to learn something new now and then.)
FWIW, I agree. Jujutsu seems fine, but Magit is fine too. Maybe Magit is the Blub of version control, and Jujutsu would change my life for the better, but … I seem to be able to run in circles around my Git-CLI–using colleagues as it is.
Also I'll have to say magit simply chose much better names than git. I never understood the `--onto` argument of `git rebase` because it's such a bad name. On the other hand magit calls it rebase subset and it's immediately clear; I now use this kind of rebase almost every day.
Basically, when you modify a change, jj will automatically rebase all descendants. It’s super useful!
It's true that there's more to jj than just the stuff magit gives you, but also, people should use the tools they find useful. If you're happy with magit, it's totally reasonable to keep using magit.
Yeah, I know I should have given up Windows instead...