Live data from Hacker News

Magit, the magical Git interface (2017)

emacsair.me

231–240 of 357 posts

Re: Magit, the magical Git interface (2017)

#231

I've never seen the upside. I use Emacs as my primary editor, and I regret it every time I say "today is the day I start using Magit". It is exceedingly invasive, triggering itself even when you don't ask for it (like running "git rebase -i" on the command line). The invasive stuff changes how the text editing itself works, but doesn't add deep features. In the interactive rebase case, I lose the ability to treat the…

Some tools inspire reactions like this. Nix and NixOS also fall in this camp. The small number of people who love them write blog posts and comments evangelizing them. The much larger number of people who find no use for these tools, or who tried them and do not like them, do not find it worth the energy to write something about why they did not like the tool or why they just never bother to try it. Even if they did…

Is there a name for this type of bias?

Re: Magit, the magical Git interface (2017)

#233
post #203

Earlier quoted context omitted.

Magit has great support for staging parts of lines - select the section you want to stage and press 's'.

> Magit has great support for staging parts of lines This is news to me. > select the section you want to stage and press 's'. It stages line-wise for me. How do I get it to stage less than an entire line?

When your press 's', you should have a region selected, in order to stage that region - if your cursor is just sitting on a line without selecting part of it, you'll (probably) just get the whole line staged.

Re: Magit, the magical Git interface (2017)

#234

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…

What I dislike with git terminal UI is that commands reflect the innards of git, not what the user wants to do. It also forces a deeper understanding of the innards for basic commands than ought to be necessary. Examples where undoing an operation looks totally different to doing it: - To stage a change you `add` it, to unstage you `reset HEAD` - To commit you `commit`, to undo a commit you `reset --hard HEAD^` The l…

> If you mistype it and nuke more than the last commit, that's also a bit bad - and fairly easily done.

If you ever run into this, you can use `git reflog` to see the history of your local actions. It's possible to revert almost any action with it.

Reset a few commits that you've never pushed to remote? No worries! Just go to `git reflog`, find a point before it happened, and `git reset` to it.

    $ git reset --hard HEAD^^ # OOPS
    $ git reflog
    c48300f3 (HEAD -> master) HEAD@{0}: reset: moving to HEAD^^
    527e26e0 (origin/master) HEAD@{1}: commit: air-interpreter-wasm = "=0.14.10"

    $ git reset --hard HEAD@{1}
And you're back before "OOPS" :) It's really hard to lose changes once they've been committed.

Re: Magit, the magical Git interface (2017)

#235
post #69

Earlier quoted context omitted.

Ok, let me try. I prefer IntelliJ's git interface. Magit can do everything IJ can, but in IJ, I can find how to do things more easily and it just feels easier to do things, probably because it's much more GUI than text compared to Magit. For example, difficult merges are extremely easy in IntelliJ, I can edit code in the diff view itself while I resolve conflicts... in Magit it requires getting used to the different…

IntelliJ is amazing, and I'd love to have a standalone version of its git frontend for my slower machines.

https://youtrack.jetbrains.com/issue/IDEA-152437

There's a little bit of discussion on it.

Re: Magit, the magical Git interface (2017)

#236
post #203

Earlier quoted context omitted.

> Magit has great support for staging parts of lines This is news to me. > select the section you want to stage and press 's'. It stages line-wise for me. How do I get it to stage less than an entire line?

The second line you quoted tells you how.

When selecting only part of line, 's' will still stage the full line for me.

Re: Magit, the magical Git interface (2017)

#237
I I believe I was the first to implement a major feature in it which was rejected upstream! So now I maintain a fork :)

https://github.com/magit/magit/issues/4285

Thankfully, package managers such as straight.el make it very easy to configure using a fork of some repository, without breaking dependencies.

Re: Magit, the magical Git interface (2017)

#239
post #106

Earlier quoted context omitted.

IntelliJ GIT ui/ux is so completely frictionless it's magical at times. The only downside is that it makes incredibly complex operations trivial that I never learned git from the cli beyond the very basics.

Really? I tried it yesterday from within Rider and I gave up on it because I couldn't even figure out how to push or pull. Best I could find was fetch. Not the biggest deal since neither of those commands require interacting with the output which makes them equally easy to run from the terminal, but it's strange that they're not available in an immediately obvious place.

Others mentioned the shortcuts, but there's also obvious buttons in the toolbar with a green up-arrow for commit+push (the button for Commit has an option to also Push) and a blue down-arrow for pull.

Maybe you disabled the git toolbar in the menu?

Re: Magit, the magical Git interface (2017)

#240
post #229
post #167

Earlier quoted context omitted.

You can customize the menu (and I do) to add a Git menu sub panel (for lack of a better word) that has an up and down arrow for push and pull. In the lower right, there's the vcs "where you're at" that shows the current branch. From there you can see the status of your branch compared to others (if you need to fetch them), or you can update branches (even those you're not currently on) along with branch specific oper…

Oh wow I didn't know that search everything in Jetbrains products included the menus and not just the contents of the project. That's handy to know. I've been a fan of Ctrl-Shift-P in Sublime Text, so it's always good to see similar features in other software.

Double-shift can show too much, to find only actions try `Cmd+Shift+A` and type the name of the action you want to run.
Post reply on HN