search

Home  >  Q&A  >  body text

sourcetree - github上,我如果fork了别人的项目, 进行了改动。。 原版更新了。。 我要合并他的最新版使用rebase吗?

github上,我如果fork了别人的项目, 进行了改动。。 原版更新了。。 我如何把他的原版合并到我自己的分支来?

某草草某草草2777 days ago1120

reply all(3)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-04-28 09:08:13

    The method above is OK, but another method:
    Use git commands in your repo:
    Create a new remote upstream (the name can be arbitrary) git remote add upstream https://github.com/username/reponame.git The link address is the source project address of your fork project
    Then fetch the upstream code git fetch upstream
    Finally, you can merge the code on upstream into your own branch git merge upstream/master If it is not the master branch, change it according to your own situation. If your code does not conflict with the one on upstream, then everything will be fine~finished.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-04-28 09:08:13

    Send a pull request and reverse the direction

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-04-28 09:08:13

    You can rebase or merge, depending on your habits, the number of clones of your warehouse, etc. If you want to contribute back, you must also consider the other party's historical management policies.

    reply
    0
  • Cancelreply