[英]How to pull code from the repo I forked?
Say there is a project: A. 说有一个项目:A。
I made a fork: B. 我做了一个叉子:B。
I made changes to the fork (B) and made a pull request. 我对fork(B)进行了更改并发出了pull请求。
By that time main project (A) changed. 到那时主要项目(A)发生了变化。
I need to pull A (main project) to my PC, merge it with B (fork). 我需要将A(主项目)拉到我的PC,将其与B(fork)合并。
Question is - 问题是 -
How do I pull the main project (A) into my PC? 如何将主项目(A)拉入我的电脑?
I do understand that somehow it has to be a new branch (say main/master) that points to A. 我确实理解它必须是一个指向A的新分支(比如main / master)。
But not very clear how to do it. 但不是很清楚如何做到这一点。
You'll want to add the original repository as a new remote repository. 您将要将原始存储库添加为新的远程存储库。 Then you can fetch from this remote and merge your new local copy onto your changes. 然后,您可以从此遥控器中获取并将新的本地副本合并到您的更改中。
$ git remote add <name> <source>
$ git fetch <name>
$ git merge <name>/<branch>
# name = remote's nickname (i.e. upstream)
# source = remote's path (i.e. https://github.com/path/repo.git)
# branch = remote's branch name (i.e. master)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.