I’m wondering if you use any (graphical) clients to manage your Git, and if so, what client you use.

I myself have to use git professionally across all 3 major OS-es, and I currently use Sourcetree on Windows and macOS, and the Git tools built-in into IntelliJ on Linux.

Have given MaGit a try, but just couldn’t get all the shortcuts to stick in my mind.

Interested to hear your experiences!

    • killingspark ( killingspark@feddit.org ) 
      link
      fedilink
      English
      arrow-up
      18
      ·
      edit-2
      1 year ago

      The only thing I’m missing in the CLI is easy picking and choosing which change to include in a commit on a more fine grained basis than files. I sometimes have a changed file and the changes fix different issues and thus should get separate commits but with the CLI I can’t easily select the changes to be staged. At least not AFAIK.

      Edit: Richards law of posting something wrong to get fast correct answers seems to stay true, even on lemmy. Thanks for teaching me something today <3

      • The2b ( The2b@lemmy.vg ) 
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 year ago

        You can via git add -i foo.bar

        I believe the only issue with that is that it can only go by hunks. If your changes are sufficiently far away, you can select them separately. But if you change one function that should be in patch a, and another function 5 lines down that should be in patch b, I think you’re screwed

        That being said, this is all from memory, so don’t quote me on it

        • hallettj ( hallettj@leminal.space ) 
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 year ago

          I usually use git add -p to selectively stage hunks. But in git add -i I think running the patch command does the same thing to get into patch mode.

          If patch mode shows you a hunk, and you only want some of the lines you can press s to split into smaller hunks. Then you’ll be prompted whether to add each smaller hunk separately.

          If you want to stage a change that is on the same line as a change you don’t want to stage, or on an adjacent line, then you need to use e to edit the hunk. Git stages whatever changes are left when you’re done editing. The file in the working tree on disk is unchanged.

    • AdamBomb ( AdamBomb@lemmy.sdf.org ) 
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      Same, because its UX is actually really good. Years ago when I was new to git, I tried to use Sourcetree to revert a merge commit, and it would just fail. When I tried it in the CLI, it still failed, but it told me how to fix it. (I needed to specify which parent)

      That, plus it’s scriptable, plus I’m in the terminal a lot anyway. I’ll also use the IDE git client sometimes if that’s where I am at the moment.

    • TehPers ( TehPers@beehaw.org ) 
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Sorry, guess the replies are too tame. Let me help you with that.

      Anything more than the git CLI is a joke. Real developers should know how to raw-dog that thing. If you’re not octopus merging your rebased branches to deploy to prod, you’re just not a real developer.

      (I use gitui)

      • Fair comment.

        IANA developer at all. Mostly just keeping records of my dotfiles and odd bits I have playing with., and the experiments I try to run using branches. Sometimes I need a visual representation of the commits and hashes to make it easier to understand what I’m doing.

        git is my only nemesis.

  • Fork on windows, SourceGit on Linux, both have a similar UI layout to SourceTree, but are much faster/snappier.

    I really like having a clear overview of the commit history, branches and current local state. I haven’t figured out yet how to get such an “at a glance” overview in the CLI.

    For advanced stuff the CLI is still very convenient.

  • Fork !!!

    It’s hands down the best git client.

    It’s free as in: sublime text or winzip where they ask you once a month if you want to pay for it but you can just select: I’m still trying it out, and it gets out of your way.

    • It’s got a well designed tree graph like in GitKraken except it doesn’t lag
    • It’s interactive rebasing is as smooth as JJ / LazyGit, so you can edit/rename/reorder your commits except you don’t have to have to remember CLI flags since it has its own UI
    • It’s lets you commit individual lines by selecting them instead of adding/removing whole hunks like Sourcetree except it isn’t filled with paper cuts where a feature breaks in an annoying way for 2 years and you have to do extra steps to keep using it how you want.

    And one killer feature that I haven’t seen any other git clients handle: allowing me to stage only one side of the diff. As in: if I change a line (so it shows up as one removed line and one new line in git), I can decide to add the new line change while still keeping the old line.

    So changing this:

    doThing(1);
    

    into this:

    doThing(2);
    

    Shows up in git as:

    - doThing(1);
    + doThing(2);
    

    But if I still want to keep doThing(1);, I don’t have to go back into my code to retype doThing(1);, or do any manual copy-pasting. I can just highlight and add only doThing(2); to the staging area and discard the change to doThing(1);.

    So now the code exists as:

    doThing(1);
    doThing(2);
    

    Now with a one-liner example like this, we could always re-enter the code again. But for larger code changes? It’s far easier to just highlight the code in the diff and say: yes to this and no to the other stuff.

    And when you get used to it, it makes it really easy to split what would be large git commits into smaller related changes keeping your git history clean and easy to understand.

      • Yeah, I use it when ssh’d into a server, but it’s just so awkward to use.

        Sometimes it just really doesn’t want to separate a hunk. Other times you want to stage all lines except one, and you have to do a million splits just to target the lines you want to keep.

        It’d be far easier if you could just select the lines you want to affect. It’s literally the first feature shown in lazygit’s readme. I think half the reason that people use lazygit is that partial commits are so awkward to perform in most other clients.

        Luckily Fork does it as well as lazygit

      • Cyno ( Cyno@programming.dev ) 
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        I still don’t think it’s nearly as convenient as being able to just see the changes side by side and click the one you want (or both). You can even easily modify the final outcome in the 3rd preview panel, in case you need to do a quick fix after a conflict resolution.

    • This is very satisfying to use and is a nice companion to the command line - I particularly use it to stage only certain lines and files from the changes.

      I tried lazygit first, but there was a consistent lag that was probably only ¼ second but it ruined the experience for me.

  • hallettj ( hallettj@leminal.space ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    Fugitive, the vim / neovim plugin. It does everything the CLI does, but uses vim interfaces very effectively to enhance the experience. For example it’s quite good for selectively staging changes from a file. I also like the option to open a buffer with the version of a file from any specified commit.

    I also tried neogit which aims to port magit to neovim. I didn’t like it as much. Partly because as far as I could tell at the time it lacked features compared to fugitive. But also because it seemed to want me to do everything through UIs in its own custom windows. Fugitive is integrated more thoroughly into vim via command mode, and special buffers.