how does sourcetree merge git branches

We just had a funny case where we were merging a feature branch back to our master branch and both Eclipse and IntelliJ "missed" merging some changes from the feature branch onto our master branch.

i.e. changes to source files did not come across to the master branch.

We tried various merge strategies (recursive, ours, octopus, etc.) with no luck.

We work in a fairly large project and were dreading having to go through and validate differences one by one.

Then I fired up SourceTree and it merged everything as expected and am just trying to figure out the difference, is anyone able to explains this?

Thanks!

1 answer

I wouldn't know why they're merging any differently. But sourcetree will allow you to see exactly what git commands it is running. You can open the command history panel.

Here's where mine was found in OSX Sourcetree (2.3.1)

image2016-7-28 12:23:24.png

Maybe that will give some clues into how sourcetree is doing it 'right'

The IntelliJ command;

git -c core.quotepath=false merge --no-commit --no-ff master-wp3b 

The SourceTree command; 

git -c diff.mnemonicprefix=false -c core.quotepath=false merge --no-commit master-wp3b 

The only obvious difference is the diff.mnemonicprefix setting.

However, the thing that appears to also be different is that we were merging to the remote branch reference remotes/origin/master-wp3b when things weren't working and to the local master-wp3b branch when things were.

So the question now becomes why would these two diverge in this context?

Thanks!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

545 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you