search

Home  >  Q&A  >  body text

There are two Git repositories, the old and the new, can they be merged?

For example:
Warehouse A: From version 1.0 -> 1.1 -> 2.0
Warehouse B: From version 2.0 -> 2.1 -> 2.2

Can warehouses A and B be merged to form a complete single warehouse 1.0 -> 1.1 -> 2.0 -> 2.1 -> 2.2?

伊谢尔伦伊谢尔伦2769 days ago590

reply all(3)I'll reply

  • 世界只因有你

    世界只因有你2017-05-02 09:30:29

    Create a new remote on B, pointing to A. Then rebase A

    git remote add upstream A
    git fetch upstream
    git rebase upstream

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-02 09:30:29

    The warehouses are independent and there is no merging mechanism. There can be branches under the same warehouse, and branches can be merged.

    reply
    0
  • 为情所困

    为情所困2017-05-02 09:30:29

    It can be done by cramming all these commits into one repo

    But you can’t change the existing commit. You can’t connect 1.1 in front of 2.0. You can only rebuild 2.0 / 2.1 with the same content after 1.1

    reply
    0
  • Cancelreply