0

I have two git repos like below in Atlassian Stash / Bitbucket Enterprise. Repo2 is forked from repo1, but has no change yet.

I would like to change repo2 to be master repo and repo1 to be fork of repo2. . How can I reverse the relation?

two repos in stash server

Jayan
  • 18,003
  • 15
  • 89
  • 143

1 Answers1

1

You could just swap the origins.

$ cd repo1
$ git remote rm origin
$ git remote add origin git@url.ext:org/Repo2.git

then

$ cd repo2
$ git remote rm origin
$ git remote add origin git@url.ext:org/Repo1.git

Alternatively, add seperate origins.

$ 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
ddavison
  • 28,221
  • 15
  • 85
  • 110
  • 1
    That works for "local repository" I have access to. How can modify this in Stash server? – Jayan Dec 02 '15 at 04:31