Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

SourceTree fails to start merge tool, possibly because it corrupts gitconfig

I try to use SourceTree with P4Merge, but I always had issues with it (merge tool sometime starting sometime not). I searched SourceTree fails to start P4merge many times, without much result.

So I tried it with KDiff3 instead - but the results were the same.

I searched SourceTree fails to start merge tool, and found this:

It gave the idea to look at the .gitconfig file, which seems to show the source of the problem: my .gitconfig is corrupted:

[difftool "sourcetree"]
    cmd = 'C:/Program Files/Perforce/p4merge.exe' \"$LOCAL\" \"$REMOTE\"
    cmd = 'C:/Program
    cmd = 'C:/Program
    cmd = 'C:/Program
    cmd = 'C:/Program
    cmd = 'C:/Program
[mergetool "sourcetree"]
    cmd = "'' "
    trustExitCode = true
    cmd = 'C:/Program
    cmd = 'C:/Program

I never used any tool other than SourceTree to change my diff and merge tools, so I think I can safely say that SourceTree corrupts the .gitignore file when I use SourceTree / Tools / Diff / diff and merge configuration (with the slight chance of some other tool's installer doing it).


1 answer

I managed to fix it by changing .gitconfig to look like this (other parts of .gitconfig not included):

    tool = sourcetree
[difftool "sourcetree"]
    cmd = 'C:/Program Files/Perforce/p4merge.exe' \"$LOCAL\" \"$REMOTE\"
    tool = sourcetree
[mergetool "sourcetree"]
    cmd = 'C:/Program Files/Perforce/p4merge.exe' \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
    trustExitCode = true

et voilá!

I have a working merge tool in SourceTree!

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events