Git merges from another fork

I have a repository on github, and someone else forked it and made changes.

I want to:

  • Create a new branch
  • Merge their changes into my branch

I created a new branch:

git commit -b my_new_branch 

How to merge their code into this new branch?

This is the branch I created: https://github.com/poundifdef/VirginMobileMinutesChecker/tree/widget_toast

This is the branch I want to merge: https://github.com/xbakesx/VirginMobileMinutesChecker

What is the best way to do this? I tried pull and it won’t work. I honestly have no idea what I'm doing in gitland, so if there is a better way to do this (besides creating a branch and trying to merge), I’m all ears!

+44
git git-branch github
Apr 09 2018-11-11T00:
source share
1 answer

Add your github fork replicas as remote to the clone of your own repo:

 git remote add other-guys-repo <url to other guys repo> 

Get your changes:

 git fetch other-guys-repo 

Reserve the branch you want to merge into:

 git checkout my_new_branch 

Combine their changes (provided that they have done their work on the main branch):

 git merge other-guys-repo/master 

To resolve conflicts, make decisions and voila.

+90
Apr 09 2018-11-11T00:
source share
β€” -



All Articles