Best Git Tool For Mac



Creating merge conflict

Best Git Tool For Mac

For sake of the demo, I'll use remote git repo, and locally cloned repos on 2 different instances.I'll make changes in python's simple server script. The base is

Husky is a tool that makes handling Git hooks a lot easier, and lets you run the scripts you want at those stages. It works by including an object right within your package.json file. It works by including an object right within your package.json file. A free Git client for Mac and Windows. This desktop app is designed to simplify how you interact with your Git repositories so you can focus on coding. What really stands out this Mac developer tool from other apps is a simple Git GUI helping developers visualize and manage hosted and local repositories.

And now I make changes on instance1:

Best git client for mac reddit

Then I commit and push this changes to remote.

Similarly, I make changes on local repo on instance2:

Mac

Then I commit these changes, and try to push, and get expected error:

So, git says that I should pull changes from remote. I pull changes, and get conflict:

How to resolve this conflict?

Git

Conflict is a part of code, where SCM (git) cannot univocally determine which changes to use in merging file. In my case, I made changes on same parts of codeI open python2-simple-server.py and see this for first conflicting part:

So, here in the code I have uncertainty, git don't know what to choose - simply saying, transfer to +79111111111 or to +81500000000. And I need to choose myself, which part to use, or maybe totally override this section. I can manually remove <<<<<<< and >>>>>>>, and edit content between this brackets. There's a merge tools, and I want to tell about my favorite ones.

GUI tools

Sublime Merge is a powerfull merge tool, intuitively understandable and with good UI. It has free and commercial versions. Free version comes with light theme only, paid version has light and dark themes.

VScode has integrated merge tool, also powerfull and with good UI.

Console tool

Recently I openned for myself vimdiff, and very liked it. To work with this tool need to know vim basics, especially how to navigate between splitted windows (Ctrl + w + one of navigation keys. Navigation keys are h, j, k, l).

Setup process

Make vimdiff as default git merge tool:

There's 2 options for conflictstyle - merge, which is default option, and diff3. Diff3 adds common ancestor in the view, it will be described below.

Now I may run conflict resolver as git mergetool:

Best git tool for mac download

At first glance this may be look ugly. But you may install attractive color schemas, and vim will be very nice looking. Sublime merge and VSCode both splits window to 3 parts. Vimdiff splits it to 4 (with diff3 configstyle), displaying common ancestor

Best Git Tool Macos

On the screenshot, from left to right, there's file with LOCAL version, on center - BASE version (common ancestor), and 3rd is REMOTE version. Window on the bottom is file which will be MERGED.

Resolving process

Best Git Tool For Macbook Pro

Since vim is an editor, which designed to work with keyboard only, without mouse, you need to use this commands to choose which version to use in conflicting part of code. Move your cursor to the highlighted conflict area, and choose one of this versions:

e.g. run :diffg LO to use local changes.

Please enable JavaScript to view the comments powered by Disqus.

Best Git Diff Tool For Mac

You May Like