search

Home  >  Q&A  >  body text

gitlab和github下fork后如何同步源的新更新

gitlab或github下,a开发者fork了b开发者的项目后,如果b开发人员更新代码后,a开发者如何获得更新?

或者推荐一个满足该场景的工作流。不胜感激!

过去多啦不再A梦过去多啦不再A梦2772 days ago722

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-05-02 09:20:39

    Please refer to one of my answers on Zhihu:

    http://www.zhihu.com/question/20393785/answer/30725725

    There are screenshots for every step.


    Of course, that is a method that does not require the command line at all. In fact, I still recommend the command line. The process is as follows:

    1. First of all, make sure whether the remote source of the main repo has been established:

      git remote -v
      
    2. If you can only see your own two sources (fetch and push), you need to add the source of the main repo:

      git remote add upstream URL
      git remote -v
      

      Then you can see upstream.

    3. If you want to merge with the main repo:

      git fetch upstream
      git merge upstream/master
      

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-02 09:20:39

    The simple operation is to create a Pull Request under a certain Repo of account A on Github and then target the source code of B, then finally agree and merge

    Of course, if you are familiar with the comment line, the one mentioned above can also be used. In fact, the principle is the same

    It seems there is no fully automatic method yet

    reply
    0
  • Cancelreply