1

Possible Duplicate:
Always use version from merged branch on conflicts

I have a git repository which has two branches: master and upstream. The upstream is set to a remote github repository. We've issued these commands to grab changes from upstream and merge with our master branch:

git checkout upstream 
git pull 
git checkout master 
git merge upstream  

It keeps giving merge conflict errors. What I'd like it to do is for any files that have conflicts, overwrite the master file with the one from upstream.

Can anyone give me some guidance on how to fix this? We're basically trying to get the latest code from the upstream repository and merge it into our own code.

Thanks!

Community
  • 1
  • 1
g1tg1t
  • 11
  • 1
  • I think this is a duplicate of: http://stackoverflow.com/q/6160214/223092 – Mark Longair Aug 22 '11 at 15:15
  • What does `git --version` report for you? – Mark Longair Aug 22 '11 at 15:20
  • Ah, that option was only added in 1.7.0, I'm afraid. (1.6.0.2 was released in September 2008.) Is upgrading an option for you? – Mark Longair Aug 22 '11 at 15:28
  • I just upgraded git. And then ran the command: git merge -s recursive -X theirs upstream. It gave a bunch of conflict errors and then said: Automatic merge failed; fix conflicts and then commit the result. – g1tg1t Aug 22 '11 at 15:40
  • Even though it still gave the errors, it appears to have worked. Thanks so much for your help! – g1tg1t Aug 22 '11 at 15:47
  • That's very strange. I just tried the same again myself (with git 1.7.0.4) and the conflicts were resolved properly in favour of upstream. Which version are you now using? – Mark Longair Aug 22 '11 at 15:48
  • Well, that's puzzling, but I'm glad to hear that's worked for you :) – Mark Longair Aug 22 '11 at 15:50

0 Answers0