Why is "resolve using theirs" not available in SourceTree?
Asked by Jeremy Glazman:

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?


Answers:
author: stevestreeting
body: 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.

comments: author: Jeremy Glazman
body: 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.


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


author: Che Fisher
body: 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.


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


author: Che Fisher
body: 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 \*?


author: Jeremy Glazman
body: you can use a wildcard: \*.mdb

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


author: Che Fisher
body: 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.


Tags: conflict

git

merge

resolve