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 vote

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

2,029 views 1 5
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