Live data from Hacker News

Magit, the magical Git interface (2017)

emacsair.me

261–270 of 357 posts

Re: Magit, the magical Git interface (2017)

#261

Magit is insanely ergonomic. Like how easy is it to selectively stage portions of files in the git CLI? In magit it is usually just a few keystrokes. I wish magit-forge [0] had more features though - like I cannot create new labels from it. Please consider donating [1] to the developer if it has made your life any easier. [0] https://github.com/magit/forge [1] https://magit.vc/donate/

https://jonas.github.io/tig/

A terminal ncurses alternative to Magit :)

    What is Tig?
    
    Tig is an ncurses-based text-mode interface for git.
    It functions mainly as a Git repository browser, but
    can also assist in staging changes for commit at
    chunk level and act as a pager for output from
    various Git commands.

Re: Magit, the magical Git interface (2017)

#262
post #43

Magit is such an unbelievably good piece of software. If you haven't used it, please at least take a look. It seems like "just a GUI for git", but that's missing the point — many operations suddenly become frictionless, so your entire workflow changes. I regularly do things like "stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one,…

> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for vi…

> I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience?

My big hang-up with interactive rebases is that I do them just infrequently enough that what exactly a set of choices will yield—what's going in the commit message, et c.—is something I have to sit there and reason about for a really long (by the standards of something that really is not that complicated an operation) time. I can also never keep it straight when editing messages in-line will have an effect, and when it'll be ignored (in some commands it is, IIRC, in others not? I can never remember, but either way, why the hell let me edit it if it won't do anything?)

What I could really use is a live preview of what the effects of my current choices will be.

Re: Magit, the magical Git interface (2017)

#263
post #59

I was pretty skeptical about magit at first because I know all the basic git commands for my daily workflows by heart and I don't find them to be very difficult or slow to use. But since I am also an Emacs user and everybody kept telling me to try it out I finally forced myself to use it. And I must say it is very easy to pickup and use productively. It is way better than most of the git integration features you get…

> I was pretty skeptical about magit at first because I know all the basic git commands for my daily workflows by heart and I don't find them to be very difficult or slow to use

Same here. I've found completing-read for branch names to be one of the biggest draws for Magit, personally. I can tab-complete them in my shell, but it's much slower and less reliable.

Re: Magit, the magical Git interface (2017)

#264

Earlier quoted context omitted.

“ - To commit you `commit`, to undo a commit you `reset --hard HEAD^` The last example is also where you get pointed to an unsafe command” Who pointed you there? If I want to undo my last commit, meaning the commit itself, not the changes to my file tree, shouldn’t I say `reset --soft`?

I've been using git for ~8 years and I've never heard of --soft

The default for `git reset`, which is `--mixed`, may do what you want. The difference between `--mixed` and `--soft` is that the former resets the index as well as moving the HEAD pointer; the latter only moves the HEAD, so if you’ve `git add`ed any changes, they will remain staged.

Re: Magit, the magical Git interface (2017)

#265

Ohhh. "Magit" like "magic". I've been pronouncing it "maggot" this whole time.

This is almost embarassingly geeky, but I pronounce it as "MAH-giht" because the spell list in the original Wizardry game used "MA" as a prefix for the "upgraded" version of mage spells. E.g. "Halito" was "little fire" and "Mahalito" was "big fire". So it's "version control UI" and "better version control UI"

Re: Magit, the magical Git interface (2017)

#266

For the sake of discussion, can we get some contrarian views? I'm using magit, along with tig, plain git and sometimes (!) even plain "vc", depending on context. I'm in the camp that thinks it's ok and it's pretty comfortable to use within emacs, but I don't see the earth shattering praise I see every time it's mentioned here. Tig for example is so much faster for history and blame perusal that I find it faster to ke…

My contrarian view: I pronounce it maggot. I think Mag-it sounds weird.

That said, I’ve financially backed Magits development (Kickstarter iirc) and I use it almost everyday, but I don’t do merges with it. I’ve had some large merges go really slow thru Magit. So I always do my merges in the terminal using the plain git CLI.

Re: Magit, the magical Git interface (2017)

#267

Earlier quoted context omitted.

> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for vi…

> I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? My big hang-up with interactive rebases is that I do them just infrequently enough that what exactly a set of choices will yield—what's going in the commit message, et c.—is something I have to sit there and reason about for a really long (by the standards of something that really is not that com…

I prefer to do my interactive rebases in steps, instead of all at once.

If I want to rebase changes onto a different commit, re-order them and squash some of it, I'll rebase as-is first, then do another rebase and reorder everything so that squashes are next to each other (and yes, sometimes this means unnecessary conflict resolutions), then a final rebase to squash. I'll edit messages last.

Re: Magit, the magical Git interface (2017)

#269
post #65

Earlier quoted context omitted.

> Commands are invoked, not by typing them out, but by pressing short mnemonic key sequences. It also sounds magical in the worst kind of way.

Actually, what makes Magic fantastic is that it continually shows the commands and the various action keys in the gui. This provides a very accessible way of learning a very complex tool.

I love command line tools that provide hints or "command palettes". Typical CLI stuff is great for things I use at least once a week, and usually only in a couple ways. It's terrible at presenting me stuff I could be doing that I don't know about [edit: yes, I know how to use apropos, which is great but still something you have to think to go query on your own], or reminding me how to do the fifth-most-common thing I do with a tool, but that I do only 10% as often as the fourth-most-common, so I have to look it up every single time.

Git is full of that kind of thing. Tealdear and friends usually save me from digging through SO posts or manpages, so remove much of the pain, but it's still worse than having a reminder already on the screen.

(actually, some kind of automated tealdear in a second term or tmux pane, reading what I'm typing with some kind of auto-complete magic so it can show me options quickly even for longer commands, and smart enough to look up "git rebase" as "git-rebase" or whatever, would be amazing... I'll have to look into that)

Re: Magit, the magical Git interface (2017)

#270
post #43

Magit is such an unbelievably good piece of software. If you haven't used it, please at least take a look. It seems like "just a GUI for git", but that's missing the point — many operations suddenly become frictionless, so your entire workflow changes. I regularly do things like "stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one,…

> I would say that Magit and structural editing using Paredit are the two most important technologies that make programming great.

I would also add undo-tree to that list, it's like having a lightweight VCS on every file without needing to resort to git.

Post reply on HN