首页 > 技术文章 > 使用gitlab时候 fork仓库不会实时从主仓库更新解决方案

monley 2019-03-05 23:53 原文

付费用户可以使用现成的方案,地址见 链接

但是私有gitlab时候,需要手动进行如下操作

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

3. Updating your fork from original repo to keep up with their changes:

git pull upstream master



原文操作见链接

更多相关链接
https://stackoverflow.com/questions/3903817/pull-new-updates-from-original-github-repository-into-forked-github-repository/3903835#3903835
https://help.github.com/en/articles/fork-a-repo


gitlab和github 在这方面上还是有些不同,github会自动同步,可以节约很多时间

推荐阅读