git - 如何在不添加单独 Remote 的情况下使我的 fork 保持同步?

标签 git github

假设 GitHub 上有一个存储库 someone/foobar,我将其 fork 到 me/foobar

我如何从父存储库中 pull 新提交直接到我的复刻,而不必 add a separate remote 并记得定期从那里 pull

目标是:

  • git pull 从父仓库中获取
  • git push 将所有内容发送到我的 fork

最佳答案

打开 fork 的 Git 存储库 me/foobar

点击比较:

Here is a sample image of the page

您将收到通知:

There isn't anything to compare.
someone:master is up to date with all commits from me:master. Try switching the base for your comparison.

点击此页面上的switching the base:

Here is an example on the page

然后你会看到在你 fork 它的那一天之后对 someone/foobar 所做的所有提交。

点击创建 pull 请求:

Here is a sample page

为 pull 请求提供标题和描述,然后单击创建 pull 请求

在下一页上,滚动到页面底部并单击Merge pull requestConfirm merge

您的 Git 存储库 me/foobar 将被更新。

编辑:这里显示 rebase 选项:

enter image description here

关于git - 如何在不添加单独 Remote 的情况下使我的 fork 保持同步?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20984802/

相关文章:

web-services - SOA Web 服务 - 如何在 Git 上管理个人服务开发

svn - 使用 Git-Svn 克隆一个非标准的 Svn 存储库

github 存储库作为 git 模板目录

github - 无法在 github 搜索中排除多个作者

git - 撤消 "Reverting a pull request"

node.js - 将 GitHub 项目的分支发布到新的 NPM 模块,但保留与原始模块 merge 的选项?

git困惑-用分支覆盖master?

git子模块 "--reference"参数

git - 在 Jenkins 上推广所有构建以掌握

linux - 使用 'git remote add origin' 创建一个全局远程而不是一个本地到当前目录/repo