Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Move repository without changing URL

Ken Williams November 18, 2015

My company has a Stash server whose project structure has grown, um, "organically."  We would like to reorganize our projects, but the single problem blocking us is that each project's clone URL includes the project code.

Is there a way to move a repository from one project to another without changing its clone URL?  If not, is there a way to reorganize the project browsing pages in Stash without affecting the clone URLs?  Failing both of those, can a remnant of the project be left behind so that the old URLs will redirect to the new URLs somehow?

If *none* of that's possible, it would be great to configure Stash/Bitbucket to not include the project code as part of the URL from the very beginning, so that this issue could be avoided for future repos.

We're using Stash v3.10.0, installed locally on our servers.

4 answers

1 vote
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2015

>Is there a way to move a repository from one project to another without changing its clone URL?  

No

>If not, is there a way to reorganize the project browsing pages in Stash without affecting the clone URLs?

No

>Failing both of those, can a remnant of the project be left behind so that the old URLs will redirect to the new URLs somehow?

You could fork the repo and enable fork syncing, but that seems messy.

The better thing to do is to just reorganize the repos and then change their local remote URLs.

You can do this with the command

git remote set-url origin <new-url>

 

 

0 votes
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2015

Persistent URLs are a long outstanding feature-request:

https://jira.atlassian.com/browse/BSERV-3751

You might vote for this as well

0 votes
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2015

Hi Ken,

There's an experimental plugin available that will flush a message to existing users when they try to clone from the old repository location. You'll have to build it from source, but you might find it useful.

cheers,

Tim

0 votes
GabrielleJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2015

The URL will be change if you move them between projects and your local remote URLs will have to be updated.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events