完全跟原仓库同步

1
2
3
4
git clone git@github.com:weilining/freenom.git
cd freenom
git remote add upstream git@github.com:luolongfei/freenom.git
git fetch upstream && git reset --hard upstream/master && git push -f

Ps: upstream/默认分支

保留更改同步

1
2
3
4
5
6
7
git clone git@github.com:weilining/freenom.git
cd freenom
git remote add upstream git@github.com:luolongfei/freenom.git
git fetch upstream
git checkout master
git merge upstream/master
git push origin master

参考

https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork

https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork

https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/merging-an-upstream-repository-into-your-fork