Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Magit is an exceptionally well made interface to Git. Yes, it’s built on top of Emacs, and that might stop many from even looking into it. - I am glad I made a deep dive into Emacs last year, and although I stopped using it as an IDE (VS Code is just too good), I still come back to it because of Magit (and macros, general text editing and org-mode). Yes, I have an interface for Git in VS Code as well, but it‘s very rudimentary compared to Magit, and it’s limited to the narrow left bar. And to give an example: Making „micro commits“ by staging various lines of changes is super easy in Magit, but I still haven‘t found out how to select several disconnected lines for staging in VS Code.


You should check out edamagit, magit for vscode! https://github.com/kahole/edamagit


I just found this earlier this week and this as a key ingredient of VSpaceCode (Spacemacs bindings) enabled me to finally able to switch to VS Code for Elixir & Javascript programming, which has made me so much happier.


> I still haven‘t found out how to select several disconnected lines for staging in VS Code.

In the Source Control window, select your file then in the right panel:

- Select the first range of lines

- Alt + select the second range of lines

- Cmd + Shift + P > "Git: Stage Selected Ranges"

or in multiple steps (I usually do it like that):

- Select the first range of lines

- Cmd + Shift + P > "Git: Stage Selected Ranges"

- Select the second range of lines

- Cmd + Shift + P > "Git: Stage Selected Ranges"


Or just right click on the selected lines and Stage Selected Range


VSCode with Gitlens is the best git GUI experience I've had. I prefer most operations via git cli, but for commiting partial changes and merge conflicts, it's everything I could ask for.


I just discovered that GitLens has been acquired by GitKraken. Considering that GK's entire business is "buy our premium Git GUI because the free ones suck", I have to wonder if they'll try going to intentionally wreck the extension. Fortunately it's MIT licensed.


I disagree. It's ok. But it doesn't even have a DAG viewer. What kind of GUI doesn't even have `git log --tree`?

Hopefully that's just because VSCode didn't allow arbitrary widgets until recently. Presumably they're working on it.


Git Graph [0] already exists as a different extension from GitLens. It works quite well, although of course it would be nice if the two extensions could integrate with each other.

[0] https://marketplace.visualstudio.com/items?itemName=mhutchie...


That looks nice! Yeah these things are so integral to development it would be nice if they were just core features of VSCode.


i agree. vscode is my magic these days.


Spacemacs.org brings the vi modal editing configuration to bear and is highly recommended.


If you just want that you don't need spacemacs, just evil mode.


Well, I physically cannot take the keystroke geometry if stock emacs for any stretch of time; the space bar approach is crucial for me.


Evil mode supports leader keys. It’s pretty trivial to setup.


The real value of Spacemacs is which-key and having everything already configured with semantic leader key setups. Like you can absolutely do that yourself but at that point you're implementing Spacemacs.


Open the diff, select the lines, right click, "stage selected lines".


But how do you select lines / changes spread all over the file? Doesn‘t work via Shift or Command click.


Actually it might require the gitlens extension. It's very well integrated and I've been using it for so long I don't know where one ends and the other begins. Regardless, if you open the diff view, the right hand side is editable and you can make selections like any other view.


You can either do it multiple times (my preference), or you can use Alt for multiple selections.


Have you used Git Lens yet?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: