有新旧两个Git仓库,能否进行合并?
伊谢尔伦
伊谢尔伦 2017-05-02 09:28:29
0
3
589

打个比方:
仓库A:从版本1.0 -> 1.1 -> 2.0
仓库B:从版本2.0 -> 2.1 -> 2.2

能否将仓库A和B合并,形成 1.0 -> 1.1 -> 2.0 -> 2.1 -> 2.2 的完整单一仓库?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(3)
世界只因有你

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

git remote add upstream A
git fetch upstream
git rebase upstream
淡淡烟草味

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

为情所困

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template