简体   繁体   English

如何从我分叉的repo中提取代码?

[英]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.

相关问题 如何从forked repo更新pull请求? - How to update a pull request from forked repo? 如何恢复合并到我分叉的仓库的拉取请求,而不是合并到我的该仓库副本 - How to revert a pull request that was merged to repo I forked from, instead being merged to my copy of that repo 如何解决来自派生回购请求请求的合并冲突 - How to resolve merge conflicts on pull request from forked repo 如何将分叉存储库中的提交合并到私有存储库? - How do I merge commits from a forked repo to a private repo? 如何向分叉仓库发送拉取请求 - How to send a pull request to a forked repo 没有派生回购请求 - No Pull Request to forked Repo 当合并请求来自派生仓库时,如何合并合并请求冲突? - How to merge pull request conflicts when pull request is from a forked repo? 当我有来自不同用户的不同请求请求时,如何在从仓库的分支版本合并之前在本地测试请求请求 - How do I test a pull requests locally before merging from a forked version of my repo when I have different pull requests from different users 如何针对派生仓库中两个分支之间的差异的上游基础创建拉取请求? - How do I create a pull request against an upstream base that is the difference between two branches in my forked repo? GitHub:如何从forked存储库创建pull请求到上游repo只包括一些过去的提交 - GitHub: How to create pull request from forked repository to upstream repo only including some past commits
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM