Git fork出来的Project和源Project保持同步

  • Post author:
  • Post category:其他


我们想要使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命令



版权声明:本文为m00123456789原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。