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

Can/Does SourceTree use local git config for Merge and Diff tool settings?

Eriks Vitolins July 23, 2017

It seems that setting a custom tool for either merging or diffing is always set within git's global config area.

Due to the needs of our team, I require explicit control of the merge workflow for all team members, and need to automate the settings of custom diff tools.  (aka Unity & UnityYAMLMerge).

Example config items:

mergetool.sourcetree.cmd=/Applications/Unity_5_5_3/Unity.app/Contents/Tools/UnityYAMLMerge merge -p $BASE $REMOTE $LOCAL $MERGED
mergetool.sourcetree.trustexitcode=true
difftool.sourcetree.cmd=/Applications/Unity_5_5_3/Unity.app/Contents/Tools/UnityYAMLMerge merge -p $BASE $REMOTE $LOCAL $MERGED
difftool.sourcetree.path=

 

Ideally, I would like to have my team's local git config set to control these behaviors... allowing explict workflows per repo.

Am I missing something, or does SourceTree only utilize the global config in this respect?

 

Secondly...

It seems that manually editing the global config settings for SourceTree's custom Diff and Merge tools seem to be overwritten when relaunching the application.  This removes any chance of automation, and requires each team member to enter custom tool paths/variables manually.


It seems that SourceTree does not reference `~/.gitconfig` on launch, but overwrites it on launch (I'm guessing from a separate, SourceTree-specific preferences file).  This is NOT ideal.

 

Any help would be appreciated :)


(SourceTree 2.5.1 MacOS)

 

 

1 answer

0 votes
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 25, 2017

Hi @Eriks Vitolins

To answer your questions, 

1. does SourceTree only utilize the global config in this respect?

Yes, SourceTree uses the global config only and not local config per repo for diff and merge tool.

 

2. Does SourceTree reference global config on launch?

Though we write the settings from SourceTree to gitconfig, we are not reading from it right now. Feel free to submit a bug for this on jira.atlassian.com

However, we write these info to defaults and I can share the relevant keys with you if required. Before that, I would recommend you to try setting "custom" diff / merge tool in preferences and the commands with the args and let me know if that works.  

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events