Git同步远程fork的项目

通过fork创建的项目,如果远程仓库代码进行了更新,本地需要同步的话,可以在git上创建一个上游仓库

步骤

  1. 运行git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
  2. 拉取远程仓库git fetch upstream
  3. 合并远程仓库git merge upstream/master
  4. 推送本地仓库到origin仓库git push origin master
posted @ 2018-04-12 18:40  zhuxiaoxi  阅读(299)  评论(0编辑  收藏  举报