Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github或者gitlab上fork仓库后同步源仓库的更新 #4

Open
ScoutYin opened this issue Apr 13, 2018 · 0 comments
Open

github或者gitlab上fork仓库后同步源仓库的更新 #4

ScoutYin opened this issue Apr 13, 2018 · 0 comments
Labels
Git About Git

Comments

@ScoutYin
Copy link
Owner

首先给fork后的仓库配置上游仓库

  • 查看远程状态
git remote -v
  • 配置上游仓库
git remote add upstream https://github.com/ORIGIN_OWNER/ORIGIN_RESPOSITORY.git
  • 再次查看远程状态,确认是否配置成功

同步源仓库更新

  • 从上游仓库 fetch 分支内容
git fetch upstream ORIGIN_BRANCH
  • 切换至你对应的本地分支
  • 把上游仓库的对应分支内容合并到本地对应分支
git merge upstream/master
  • 将更新push至你的远程仓库
@ScoutYin ScoutYin added the Git About Git label Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Git About Git
Projects
None yet
Development

No branches or pull requests

1 participant