Import 300+ git repositories to an altassian project

Hi,

We are evaluating Stash to help us manage our git repositories. Right now we have a single projet which is using a little over 300 git repositories. We'd like to import them in our Stash project. How can this be done?

Thanks

1 answer

1 accepted

0 votes
Accepted answer

Hi Francois,

There is no out-of-the box support for bulk importing of repositories just yet, but each of the steps in the process is fully scriptable. The basic steps are as follows:

  • Create the project and repositories in Stash. The repositories will be empty.
  • Clone the repositories from your current git server.
  • Push each of the repositories to their Stash equivalent.

We have an experimental command-line importer that supports bulk imports of a set of repositories on the local disk. You could experiment with this importer or use it as a starting point and customize it to your situation: https://bitbucket.org/atlassianlabs/stash-importer/src/ca40b471af1af673401900175a7ac5777ae8f960/src/main/resources/?at=master

If you decide to script it yourself, have a look at the following documentation:

  • Mirror an existing git repository (for the steps on how to import an existing git repository)
  • Stash REST api for the commands to create a new (empty) repository in Stash. (Make sure you provide username/password for a user that has PROJECT_ADMIN permission on the project where the repositories are to be created)

Cheers,

Michael

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

427 views 6 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you