开发者

Git merge from someone else's fork

开发者 https://www.devze.com 2023-02-23 12:48 出处:网络
I have a repository on github, and someone else has forked it and made changes. I want to: Create a new branch

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

I want to:

  1. Create a new branch
  2. Merge their changes into my branch

I have created the new branch:

git commit -b my_new_branch

How do I merge their code into this new branch?

This is the branch that I have created: https://github.com/poundifdef/VirginMobileMinutesChecker/tree/widget_开发者_如何学Gotoast

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

What is the best way to do this? I've tried a "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 accomplish this (besides my creating a branch and trying to merge) then I am all ears!


Add their github fork repo as a remote to a clone of your own repo:

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

Get their changes:

git fetch other-guys-repo

Checkout the branch where you want to merge:

git checkout my_new_branch

Merge their changes in (assuming they did their work on the master branch):

git merge other-guys-repo/master

Resolve conflicts, commit the resolutions and voila.

0

精彩评论

暂无评论...
验证码 换一张
取 消