【发布时间】:2015-12-01 16:49:08
【问题描述】:
我在Atlassian Stash / Bitbucket Enterprise 中有两个如下所示的 git 存储库。 Repo2 是从 repo1 分叉出来的,但还没有变化。
我想将 repo2 更改为主 repo,并将 repo1 更改为 repo2 的分支。 .我怎样才能扭转这种关系?
【问题讨论】:
标签: git bitbucket-server
我在Atlassian Stash / Bitbucket Enterprise 中有两个如下所示的 git 存储库。 Repo2 是从 repo1 分叉出来的,但还没有变化。
我想将 repo2 更改为主 repo,并将 repo1 更改为 repo2 的分支。 .我怎样才能扭转这种关系?
【问题讨论】:
标签: git bitbucket-server
你可以交换原点。
$ cd repo1
$ git remote rm origin
$ git remote add origin git@url.ext:org/Repo2.git
然后
$ cd repo2
$ git remote rm origin
$ git remote add origin git@url.ext:org/Repo1.git
或者,添加单独的来源。
$ cd repo1
$ git remote add actual git@url.ext:org/Repo2.git
$ git fetch actual
$ cd repo2
$ git remote add actual git@url.ext:org/Repo1.git
$ git fetch actual
【讨论】: