What is your favourite git merge tool/strategy?
Dinesh Pandiyan

Dinesh Pandiyan @flexdinesh

Joined:
Nov 14, 2017

What is your favourite git merge tool/strategy?

Publish Date: Apr 30 '18
84 35

VSCode is my favourite editor. But while rebasing and resolving merge conflicts, I switch to Atom as their git integration is too damn good for resolving conflicts IMO. Just wondering what other tools/strategies devs use in general for resolving merge conflicts.

This is my usual flow

  1. Go to terminal and git rebase master
  2. When conflict occurs, I open Atom, resolve conflict and stage the file
  3. I come back to terminal and git rebase --continue

Comments 35 total

  • Joe Clay
    Joe ClayApr 30, 2018

    My current Git workflow is:

    • VS Code's built-in Git support for check-ins and simple diffs
    • Sourcetree for the more complex bits (managing merges, rebasing, squashing commits)
    • P4Merge for resolving merge conflicts
      • I used to used Meld - the UI is a little nicer, but it's really slow to start up :(
    • Dinesh Pandiyan
      Dinesh PandiyanMay 1, 2018

      VSCode's built in git isn't that great if you ask me. I like selective staging where I can stage/unstage particular line(s), which isn't supported by VSCode. Also, you cannot use keyboard in their staging area, which is very much bad experience for me.

      Maybe we all should pool in and port the Atom's git integration to VSCode so we'll have the perfect editor of all time.

      • Mahlon Gumbs
        Mahlon GumbsMay 22, 2018

        You can stage/unstage particular lines with VSCode. I do it all the time. Only rule is that the lines must be consecutive.

    • Adam Crockett 🌀
      Adam Crockett 🌀Sep 17, 2018

      Vs codes conflict resolver is also good, no need for another tool. Source tree to Vs code.

  • Adarsh
    AdarshApr 30, 2018

    Check out Gitkraken it's a good GUI tool build for git. They support most of the git features and also make the merging and rebasing process very easy.

    • John Costanzo
      John CostanzoApr 30, 2018

      Some time ago I used that tool. But when they switched their TOC to having to pay for it for non open source stuff, I left it

      • Anthony Bouvier
        Anthony BouvierApr 30, 2018

        Same, and it started requiring an account be set up. For the desktop app. No thanks.

    • Dinesh Pandiyan
      Dinesh PandiyanMay 1, 2018

      GitKraken is good as long as you only do reads (checkout and diff) and not writes (commits and rebase) 'coz they don't support local config or multiple config in their community edition which is kind of a bummer.

    • Chad Smith
      Chad SmithJul 5, 2018

      I used to be a big fan of GitKraken, though on larger repositories it seem to just slow down to a crawl for me. It would just take forever for them to open. Sometimes spin forever.

      I also tried to use with git LFS enabled and kept having issues with it sadly.

  • Stephanie Handsteiner
    Stephanie HandsteinerApr 30, 2018

    I do my git stuff via command line, idk I learnt git on the CLI, never used a GUI for it and I just sticked to that, I guess. :D

    Sometimes I'll use Atom too, for repos being hosted on GitHub anyway.

    • Dinesh Pandiyan
      Dinesh PandiyanMay 1, 2018

      I'm still the terminal guy. You don't need anything when you got oh-my-zosh right?

      But how do resolve conflicts when you rebase?

      I usually,

      1. Go to terminal and git rebase master
      2. When conflict occurs, I open atom, resolve conflict and stage the file
      3. I come back to terminal and git rebase --continue
  • Riccardo Ferrazzo
    Riccardo FerrazzoApr 30, 2018

    I use the command line for everything except for adding things when I have lot of changes. For that thing i use gitkraken or git-gui. Being a command line user I use Vim as git editor.

  • Jonathan Boudreau
    Jonathan BoudreauApr 30, 2018

    If its a fairly complex merge conflict, I use the builtin three way merge in fugitive (vim plugin). I don't normally run into major merge conflicts though.

  • Anthony Bouvier
    Anthony BouvierApr 30, 2018

    All from the command line. Close eyes. Try merge. Pray. :D

    I'll have to check out some of the tools mentioned in rest of comments though. I think it is important to know how to do it from the CLI, but if you do know how to do that, I don't mind a tool as well.

    • Dinesh Pandiyan
      Dinesh PandiyanMay 1, 2018

      I've been working on a feature branch for three weeks now that has around 50 new commits and rebase them every single day with master. So I totally relate with closing eyes and praying part :D

  • Darryl Norris
    Darryl NorrisApr 30, 2018

    This is the best way to merge in Git.

    #### FYI: DO NOT RUN THESE COMMANDS. This will not merge instead it will force a pushed commit.
    
    git add -f . && \ 
    git commit -m "`curl -s http://whatthecommit.com/index.txt`" && \
    git push -f
    
    
    

    FYI: DO NOT RUN THESE COMMANDS. This will not merge instead it will force a pushed commit.

    • Dinesh Pandiyan
      Dinesh PandiyanMay 1, 2018

      I see what you did there 🔥

    • Mihail Malo
      Mihail MaloOct 1, 2018

      This is pretty bad, maybe copy the warning to above the code as well.

      And into the code as a comment, for good measure.

  • Tito
    TitoMay 1, 2018

    Beyond Compare is the best tool I know for handling 3-way-merge.
    I also use Fork and GitExtensions.

  • Chad Kunde
    Chad KundeMay 1, 2018

    magit (with evil-magit plugin)

    It is, hands down, the best git UI/UX I've experienced. Advanced git operations become simple and obvious.

  • Pratik Ambani
    Pratik AmbaniMay 1, 2018

    Wait!!! Wait!!! Wait!!!

    Guys, use smartgit, especially during merge and rebase.

  • Alexandru Bucur
    Alexandru BucurMay 1, 2018

    Are you using gitlens in VSCode ? It helps a lot on the normal git flow (including merges)

    • Doruk Kutlu
      Doruk KutluAug 28, 2018

      +1 for gitlens

      It has a learning curve, but once you invest the time, it's worth the savings.

    • Al Romano
      Al RomanoFeb 21, 2019

      +1 for GitLens.

      As Doruk says below it does have a bit of a learning curve but it's totally worth it.

      I've uninstalled GitKraken now because of it.

      Between the side-bar additions and the command palette items you should be able to git ninja your way out of most situations.

      There is always Git in termial if you need to go full hacker mode. :)

  • Yoandy Rodriguez Martinez
    Yoandy Rodriguez MartinezMay 4, 2018

    Emacs + Magit, It's a really great tool even if you're and experienced git user

    • Maria Zaitseva
      Maria ZaitsevaAug 25, 2018

      Same here. Especially magit's interactive rebase makes rebasing so painless it always went flawlessly for me.

  • Jan De Dobbeleer
    Jan De DobbeleerJun 9, 2018

    Same, but replace Atom with Code 🤓

  • Adam Crockett 🌀
    Adam Crockett 🌀Sep 17, 2018

    I shout at people to stop them working on my files. 😆 Just kidding.

  • Matthieu Vion
    Matthieu VionSep 26, 2018

    GitKraken may be an electron app, it works very well merge, conflict resolving, the only downside is that it does not sign commits with GPG /:

  • Pin-Sho Feng
    Pin-Sho FengJan 20, 2019

    My favorite tools are TortoiseGit + Beyond Compare, but TortoiseGit only works on Windows. On Mac I use SourceTree with Beyond Compare as well.

  • EkaterinaS
    EkaterinaSJul 26, 2019

    My favorite git merge tool is Code Compare
    Code Compare can be integrated into a variety of version control systems that support external comparators. Code Compare extends VCS native comparison functionality with its advanced approach to file comparison and merging.

Add comment