Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why is "resolve using theirs" not available in SourceTree?

Jeremy Glazman
Contributor
June 26, 2012

I have a merge conflict of some binary files in SourceTree, and I want to just discard my changes and use the latest version committed to git. Normally I would do this by selecting: Resolve Conflicts | Resolve Using 'Theirs'

However, this option is greyed out in the menu and can't be selected. My only option is to Resolve Using 'Mine', but I don't want to do that. Why would this happen?

Trying to reset the file while in this state also fails, saying the file 'is unmerged'.

Selecting Resolve Using 'Mine' removes the file from my pending changes list, which is also confusing; shouldn't the file now be the locally modified version?

2 answers

1 accepted

0 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 26, 2012

Hmm, the Resolve Using Theirs option is enabled when SourceTree detects that you're in a merge situation (or rebase actually), ie that there's more than one parent to the current working state. If it's disabled, it suggests it thinks that's not the case. Did the conflict come from something other than a merge/rebase action, such as a patch or stash? Unfortunately there's no context in that case, although the usual default behaviour in that case for binary files is for the default state to be 'theirs' anyway, so if it looks OK you can just use 'Mark Resolved'.

'Resolve using Mine' puts the file into the state on the branch you're on, so it's not modified any more, that's why it doesn't show up after you do that.

Jeremy Glazman
Contributor
June 27, 2012

OK I think I get it. All I did was a pull with "commit merged changes immediately" enabled, which resulted in a conflict with a locally modified (but not committed) file.

So in this context Resolve Using 'Mine' must refer to the latest commit in the local repository (which would be the thing that just got pulled) and not my working copy. I supposed technically they are both 'mine' at that point, but one is more 'mine' than the other lol.

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2012

Ah, I see. The moral of this story is to commit before you pull, everything's much cleaner that way :)

Che Fisher February 3, 2014

Hi guys, sorry for the noob question - I actually think I want something similar to 'resolve using mine' but it's grayed out for me. As the devs here use both windows and mac, we use Github>Sourcetree>Unity>Xcode (for us Mac kids). At the Unity part, we Mac users install 2 plugins which resolve some errors for us.

My problem is that every time I change a branch I must re-import the plugins to Unity (and change many of the build settings back to what I need!). I am simply a tester (for now....!) and so don't code or push anything to the repo. What I want is for SourceTree to STOP trying to pull the following files (which I assume to be those changed by the plugins since I don't code diddly) but still pull everything else.

The error thrown is...
This file is different and stuff: (Commit or stash you noob!) SGMultiplayerClient/Assets/lib/MyFileLogic.dll.mdb

Any suggestions? Sory to hijack.

Jeremy Glazman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 3, 2014

You can probably just add that file to your .gitignore file, then git won't track it anymore.

Che Fisher February 3, 2014

I think I tried this but I'll try again... for reference, do I just put the full path to the file or will I need some sort of operator? Like '!' or a wild card *?

Jeremy Glazman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 4, 2014

you can use a wildcard: *.mdb

or you can use a path to the file relative to the .gitignore file

0 votes
Che Fisher February 3, 2014

Hi guys, sorry for the noob question - I actually think I want something similar to 'resolve using mine' but it's grayed out for me. As the devs here use both windows and mac, we use Github>Sourcetree>Unity>Xcode (for us Mac kids). At the Unity part, we Mac users install 2 plugins which resolve some errors for us.

My problem is that every time I change a branch I must re-import the plugins to Unity (and change many of the build settings back to what I need!). I am simply a tester (for now....!) and so don't code or push anything to the repo. What I want is for SourceTree to STOP trying to pull the following files (which I assume to be those changed by the plugins since I don't code diddly) but still pull everything else.

The error thrown is...
This file is different and stuff: (Commit or stash you noob!) SGMultiplayerClient/Assets/lib/MyFileLogic.dll.mdb

Any suggestions? Sory to hijack.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events