Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 我可以将 git 上的分叉项目更新为原始/主副本吗?
假设我 fork 一个项目,然后将其克隆到我的机器上。
此时,git pull, 以及git fetch,git rebase origin/branch_name参考我的分叉存储库。如果我想变基到原始存储库的主库,我将如何做呢?
git pull
git fetch
git rebase origin/branch_name
将原始存储库添加为远程
git remote add upstream git@github.com:<OriginalUser>/<OriginalRepo>.git
然后从那里变基
git fetch upstream git rebase upstream/master