Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何更新叉式git回购协议?_Git_Github_Git Fork - Fatal编程技术网

如何更新叉式git回购协议?

如何更新叉式git回购协议?,git,github,git-fork,Git,Github,Git Fork,我已经完成了git回购。 如果原点有更新,分叉回购是否会自动更新? 或者我应该在cmd中执行一些命令来更新这个forked repo吗? 这是什么命令 克隆repo时,它有一个名为origin的默认远程设备,该远程设备指向GitHub上的fork,而不是它派生自的原始repo。要跟踪原始回购,您需要添加另一个名为上游的远程回购: 正如他们在这篇文章中所说的。他们在github文档中对此主题有非常具体的帮助: 配置遥控器 克隆repo时,它有一个名为origin的默认远程 指向您在GitHub上的

我已经完成了git回购。 如果原点有更新,分叉回购是否会自动更新? 或者我应该在cmd中执行一些命令来更新这个forked repo吗? 这是什么命令

克隆repo时,它有一个名为origin的默认远程设备,该远程设备指向GitHub上的fork,而不是它派生自的原始repo。要跟踪原始回购,您需要添加另一个名为上游的远程回购:


正如他们在这篇文章中所说的。

他们在github文档中对此主题有非常具体的帮助:

配置遥控器

克隆repo时,它有一个名为origin的默认远程 指向您在GitHub上的分支,而不是它所分支的原始回购 从…起要跟踪原始回购,您需要添加另一个 远程命名上游:

引入上游变化

如果项目的原始回购协议得到更新,那么 可以通过运行以下代码将这些更新添加到fork:


最近,我更新了我的分叉回购如下。此URL解释了如何使用web UI和终端更新分叉回购

git remote add upstream https://github.com/octocat/Spoon-Knife.git
# Assigns the original repo to a remote called "upstream"

git fetch upstream
# Pulls in changes not present in your local repository, 
# without modifying your files
git fetch upstream
# Fetches any new changes from the original repo

git merge upstream/master
# Merges any changes fetched into your working files