1

Recently i forked a repository and did some commits to my new repository. Then i have done a pull request to merge with the original repository but there are some conflicts and they can't automerge. The person who manages the original repository told me to find out how to fix this conflicts but i cannot get any info about the conflicts in the github web interface. What would be the best way to do it?

As a note: since i forked there has been three minor commits in the original repository but also one i think is the problem: a file has been deleted (myfile-v4.js) and another added (myfile-v5.js), they are clearly the same file with some modifications but the name changed for versioning. One of my commits changed myfile-v4.js.

Thanks in advance

Carlos
  • 13
  • 2
  • 1
    Thank you very much for the three answers, i'll give it a golater on today. I appreciate it. – Carlos Sep 17 '15 at 09:18

3 Answers3

0
  • add the upstream github repository as a remote to your local repository
  • merge the changes in upstream into your local branch or rebase the local branch onto the main upstream branch

This way you can fix the conflicts in your local branch and push the clean branch to your github repo what will update the PR so it's auto mergable

egolus
  • 171
  • 1
  • 6
0

In git command line, do this:

  1. Clone your repo (git clone)
  2. Add their repo as a 2nd remote (git remote add second <url>) - we'll call it "second"
  3. I'm assuming your attempting to merge master to master: You already have a master branch corresponding to your master. Create a 2nd branch corresponding to their master.

First view all of your local and remote branches:

git branch -a

Then create a local branch from their master:

git checkout -b second_master second/master`

You'll now have two local branches:

master (pointing to origin/master - yours)
second_master (pointing to second/master - theirs)

Now you can try to merge:

git checkout second_master
git merge master

If there are any conflicts, you'll see them. Now you can do

git mergetool

to get a visualization of the merge. I recommend using p4merge.

Gal
  • 3,861
  • 1
  • 19
  • 20
  • Thanks for your solution but didin't work. According to the solution that worked i think i would have had to be "git merge second_master" – Carlos Sep 18 '15 at 10:30
0

Github-docs here

I am assuming that you didn't clone your forked or new repository. Please do that:

forkedRepository-URL: https://github.com/your-username/forked-repository-name, copy this from here:

enter image description here

git clone forkedrepository-URL

Now, add your author's repository, for convention let's name it original repository. Same as above, Copy-URL of your authors original repository

git remote add original COPY-URL

If you successfully added the remote repository. Now let's fetch that, we are actually pulling the original here:

git fetch original

Since we fetched the original. Let's merge them

git merge

git merge original/master

You can refer here for more details:

jalanb
  • 1,037
  • 1
  • 10
  • 33
JumpMan
  • 2,016
  • 3
  • 22
  • 37
  • 1
    Thanks for your solution. This is the one that worked, the key has been "git merge original/master". I tried +1 but i haven't got reputation for my feedback to be taken into account – Carlos Sep 18 '15 at 10:28
  • You are most welcome. I didn't get this "I tried +1 but i haven't got reputation for my feedback to be taken into account"? I upvoted your question, because I was not clear before what you were asking :) – JumpMan Sep 18 '15 at 13:56