0

I'm new git! I try contributing to a project user2:master, and make a pull request. Then I needed to fix something, so I did. I made the change, push to my master branch user1:master. So now, 2 commits are seating in the pull request. user2 wants to merge my commits, but there's a merge conflict. How do can I merge these conflicts? (I think theres a conflict between the first and second commit). Thank you in advance

kirikoumath
  • 723
  • 9
  • 20
  • Without knowing more about the merge conflict, it's hard to say. Have you tried rebasing your branch on top of the upstream branch? – nwinkler Feb 26 '15 at 14:36
  • 1
    http://stackoverflow.com/questions/161813/fix-merge-conflicts-in-git – eckes Feb 26 '15 at 15:12
  • @nwinkler I have. The conflict is with pull request on user2:master, this branch is not mine and I don't have write permission – kirikoumath Feb 26 '15 at 17:09

1 Answers1

1

Difficult to say for sure without knowing more about the conflict, but the most likely reason that user2 is running into a merge conflict is he/she made some change which conflicts with your change after your last pull of the upstream (user2) repo.

The usual way to deal with this, assuming the other user hasn't merged your pull request yet is:

  1. Rebase your changes on top of the latest in user2:master, e.g. git fetch user2; git rebase user2/master
  2. This will likely cause a merge conflict. Resolve the conflict in the indicated files, test, then do git add <those files>; git rebase --continue
  3. Finally, carefully push your newly rebased commits back to your remote branch to update the pull request (you'll have to use --force, since you've technically rewritten those commits, so make sure only to do this if the other user has not merged your request yet) git push user1 master --force
lemonhead
  • 5,328
  • 1
  • 13
  • 25