【问题标题】:Could I swap fork relationship between two git repos in Atlassian Stash我可以在 Atlassian Stash 中交换两个 git 存储库之间的分叉关系吗
【发布时间】:2015-12-01 16:49:08
【问题描述】:

我在Atlassian Stash / Bitbucket Enterprise 中有两个如下所示的 git 存储库。 Repo2 是从 repo1 分叉出来的,但还没有变化。

我想将 repo2 更改为主 repo,并将 repo1 更改为 repo2 的分支。 .我怎样才能扭转这种关系?

【问题讨论】:

    标签: git bitbucket-server


    【解决方案1】:

    你可以交换原点。

    $ 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
    

    【讨论】:

    • 这适用于我有权访问的“本地存储库”。如何在 Stash 服务器中修改它?
    猜你喜欢
    • 2019-12-05
    • 1970-01-01
    • 1970-01-01
    • 2016-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多