The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Deleted user
March 9, 2016

Hi,

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Johannes Kilian
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 Champions.
March 9, 2016

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

http://stackoverflow.com/questions/914939/simple-tool-to-accept-theirs-or-accept-mine-on-a-whole-file-using-git

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**)

Deleted user
March 9, 2016

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

 

 

 

2 votes
Johannes Kilian
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 Champions.
March 9, 2016

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:

SourceTree_2016-03-09_13-44-59.png

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

 

Nomenclature:

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

Seth
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 Champions.
March 9, 2016

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

Johannes Kilian
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 Champions.
March 9, 2016

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

Deleted user
March 9, 2016

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.)

TAGS
AUG Leaders

Atlassian Community Events