Is there a quick way to accept local version in merge conflict?


For reasons that are boring and probably irrelevant, I have ended up with a lot of merge conflicts in my current project.  I know 100% that the local files on my machine are all correct.  Is there a quick way to tell SourceTree/Git that I want to resolve all conflicts by taking the current local version of all the files?

Any help would be very much appreciated.


Kind wishes ~ Patrick


2 answers

1 accepted

1 vote
Accepted answer

@Patrick Skelton: As you are looking for a recipe to use "mine" for all of your files at once, have a look here:

Haven't tested tis recipe - but it looks exactly what you are looking for. Personally I prefer doing it individually - as I don't trust those mass operations, as I'm afraid they might harm anything unexpected... (**PARANOIA**)

Hi, @Johannes Kilian 

Not as paranoid as me after yesterday, when I ended up having to destroy an entire repo and re-add the whole project (effectively wiping its history) because I got in such a mess doing a 3-way merge.  Luckily, I am the only one working on it at the moment, and I keep a 'Release Notes.txt' as part of the project.

Ironically, I think the script above would make me less paranoid.  I knew my local version was correct, so all I wanted to say to SourceTree/Git was, 'Look, I don't care what differences you find, don't touch the current version of files in my project.'

Thanks for the link.

  • Patrick




There are different methods to solve conflicts: Right click on the conflicted file within Sourcetree and you see a drop down menu to access methods resolving conflicts:


There are several methods for resolving conflicts: the one you are interested in is "Resolve using "Mine"



As I'm are trying to merge "foreign" ("their") changes into "my" repository, the following wording is used:

"Resolve using "Mine"" overwrites the result of the merge with my pre-merge version - their remote changes are ignored.

"Resolve using "Theirs"" overwrites the result of the merge with their pre-merge version - my local changes are ignored

This is a very clear description of what I've always found to be very ambiguous terms.

It's a result of my poor english: describing complicated things with a very small vocabulary. smile

That is a clear explanation.  Thank you.

(I did hope there would be a way to do that for all files, rather than have to do each one individually.)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,129 views 4 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