We are currently using BitBucket and want to move our repositories to Stash.
It documented on Atlassian Docs:
It is significat to make Bare clone, not simple Copy clone. Because if you make not a Bare mirror, you get no remote branches. And push --all will not work fine.
I used follow commands to completelly migrate from one Git to another, this will copy anything:
git clone --bare git@bitbucket.org:/login/myrepo.git cd myrepo.git git push --mirror git@stash.acme.com:/project/myrepo.git cd .. rm -rf myrepo.git
In this solution you no need to add remote.
Thanks Alexey. You're quite right - that's actually a better way to do it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wouldn't it be better to mirror the clone at the first step?
git clone --mirror git@bitbucket.org:
/login/myrepo
.git
Also, is the process repeatable if commits are made to the Bitbucket repo?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
I guess this depends on how many repositories you have to migrate? If we're talking 5-10, then frankly I would just do it manually for now.
If you have more thant that it might be worth thinking about writing a script (which we could definitely help with). You could use both the REST endpoints to query the Bitbucket repositories and re-create them in Stash.
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not specifically. It's really just the normal Stash documentation you might want to take a look at:
https://confluence.atlassian.com/display/STASH/Stash+Documentation+Home
For each repository in Bitbucket you will want to clone the repository to a machine, create a matching repository in Stash and then push all the branches/tags. Something like:
git clone git@bitbucket.org:project/repo-name.git
cd repo-name
git remote add stash ssh://git@server:7999/PROJECT/repo-name.git git push --all stash && git push --tags stash
You may then also want/need to setup user permissions on your projects as appropriate to your organization.
I hope this helps?
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Charles,
Is there some documentation somewhere on how to do this manually?
Thanks,
Dave
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for everyone's help - I'll get started with the migration today.
Dave Kunkel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.