Sourcetree Git Diff

broken image


Kdiff3, P4Merge, and Beyond Compare are probably your best bets out of the 14 options considered. 'Free and open source' is the primary reason people pick Kdiff3 over the competition. This page is powered by a knowledgeable community that helps you make an informed decision. SourceTree log for a command when I click on xlsm file is showing that GUI is calling git diff in some strange way and still treats it as a binary file: 'Command': 'git -c diff.mnemonicprefix=false -c core.quotepath=false -no-optional-locks diff -unified=3 -M -no-color - 'TestGitXL/Orica Contract Variation.xlsm ', /. apparently not git. Use the full capability of Git and Mercurial in the SourceTree desktop app. Manage all your repositories, hosted or local, through SourceTree's simple interface. On the other hand, TortoiseGit is detailed as 'The Power of Git in a Windows Shell'. It is a Git revision control client, implemented as a Windows shell extension and based on TortoiseSVN.

This article was updated for Visual Studio 2017.

Today, a short note on how to set up Visual Studio as a diif and merge tool in SourceTree and Git client. It's not commonly known that this IDE may be used for resolving merge conflicts, but as you'll see it's very simple to set up.

SourceTree config

First, open up the options window and go to Diff tab.

Change both External Diff Tool and Merge Tool to Custom. In the Diff Command field enter the full path to the vsdiffmerge.exe. For VS 2015 and below you can find it in the Visual Studio installation folder, under Common7IDE subfolder. Visual Studio 2017 has it slightly more hidden. Look under Common7IDECommonExtensionsMicrosoftTeamFoundationTeam Explorer.

As for the arguments fields, type in the following:

Diff tool: '$LOCAL' '$REMOTE' 'Source' 'Target' //t
Merge tool: '$LOCAL' '$REMOTE' '$BASE' '$MERGED' //m

Click OK, and And that's it! Now whenever a merge conflict occurs, you'll be able to resolve it using Visual Studio.

Sourcetree

The only downside I found is that vsdifftool may take quite some time to start up. But if you don't close it after diffing each file, it'll work like a charm.

Commandline Git config

By saving these settings in SourceTree, your .gitconfig file is updated with two entries: [difftool 'sourcetree'] and [mergetool 'sourcetree']. In my case it looks like the following:

2
4
cmd='C:/Program Files (x86)/Microsoft Visual Studio 2015/Common7/IDE/vsdiffmerge.exe'$LOCAL$REMOTE Source Target//t
cmd='C:/Program Files (x86)/Microsoft Visual Studio 2015/Common7/IDE/vsdiffmerge.exe'$LOCAL$REMOTE$BASE$MERGED//m

You can now use these to tell the commandline Git to use these when viewing a diff or merging. It's as simple as executing two git commands:

git config --global diff.tool sourcetree
git config --global merge.tool sourcetree

Sourcetree Tutorial

Now, git difftool and git merge commands will launch Visual Studio.

Jiffy lube tire pressure. Doing so is of course perfectly possible even without SourceTree. Just add the difftool and mergetool entries to your .gitconfig file (it should be located in your home folder) and execute the two git config commands shown above.

Diff

To add your supply request file, do the following:

Bitbucket Sourcetree Git

Sourcetree git diff between commits
Sourcetree Git Diff

The only downside I found is that vsdifftool may take quite some time to start up. But if you don't close it after diffing each file, it'll work like a charm.

Commandline Git config

By saving these settings in SourceTree, your .gitconfig file is updated with two entries: [difftool 'sourcetree'] and [mergetool 'sourcetree']. In my case it looks like the following:

2
4
cmd='C:/Program Files (x86)/Microsoft Visual Studio 2015/Common7/IDE/vsdiffmerge.exe'$LOCAL$REMOTE Source Target//t
cmd='C:/Program Files (x86)/Microsoft Visual Studio 2015/Common7/IDE/vsdiffmerge.exe'$LOCAL$REMOTE$BASE$MERGED//m

You can now use these to tell the commandline Git to use these when viewing a diff or merging. It's as simple as executing two git commands:

git config --global diff.tool sourcetree
git config --global merge.tool sourcetree

Sourcetree Tutorial

Now, git difftool and git merge commands will launch Visual Studio.

Jiffy lube tire pressure. Doing so is of course perfectly possible even without SourceTree. Just add the difftool and mergetool entries to your .gitconfig file (it should be located in your home folder) and execute the two git config commands shown above.

To add your supply request file, do the following:

Bitbucket Sourcetree Git

Sourcetree For Mac

  1. From your BitbucketStationSupplies in Bitbucket, click Source to open the source directory. Notice you only have one file, supplies.txt, in your directory.

    • A. Source page: Click the link to open this page.

    • B. Branch selection: Pick the branch you want to view.

    • C. More options button: Click to open a menu with more options, such as 'Add file'.

    • D. Source file area: View the directory of files in Bitbucket.

  2. From the Source page, click the More options button in the top right corner and select Add file from the menu. The More options button only appears after you have added at least one file to the repository. A page for creating the new file opens, as shown in the following image.

    • A. Branch with new file: Change if you want to add file to a different branch.

    • B. New file area: Add content for your new file here.

  3. Enter supplyrequest in the filename field.

  4. Select HTML from the Syntax mode list.

  5. Add the following HTML code to the text area:

    We are requesting additional supplies. Please send us the following:



    • space ice cream

    • nerf darts

    • telescope light shield

  6. Click Commit. The Commit message field appears with the message: supplyrequest created online with Bitbucket.

  7. Click Commit under the message field.





broken image