keep-your-fork-synced

fork项目后与原项目保持同步

参考链接

将远程原始repo合并到远程fork repo的本地repo后推送到远程fork repo

  1. clone远程fork repo
  2. 添加远程原始repo为upstream
  3. fetch&merge远程原始repo的分支到本地分支
  4. push到远程fork repo分支

具体操作

  1. Set up Git
  2. Create a local clone of your fork
1
git clone https://github.com/YOUR-USERNAME/REPO_NAME.git
  1. Configure Git to sync your fork with the original repository
1
2
3
4
5
6
# check the current configured remote repository for your fork.
git remote -v
# add upstream
git remote add upstream https://github.com/ORIGINAL-USERNAME/REPO_NAME.git
# verify the new upstream repository
git remote -v
  1. Fetch and merge original repository into your local repository
1
2
git fetch upstream
git merge upstream/master
  1. push to your remote fork repo
1
git push origin master
Licensed under CC BY-NC-SA 4.0
最后更新于 Feb 22, 2021
Built with Hugo
主题 StackJimmy 设计