我们想要使fork出来的Project和源Project保持同步,当源project更新时,我们fork的Project也随之更新。那么应该如何做呢?

步骤:
1.在fork的代码库中添加remote 源 ,使用 remote add 参数,如下:
git remote add upstream https://github.com/JakeWharton/butterknife
2.在每次Pull Request前,执行git remote update命令和git rebase命令,如下
git remote update upstream
git rebase upstream/{branch name}(需在git checkout branch name的基础上)
3.push 代码到github,使用git push命令

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐