Import 300+ git repositories to an altassian project


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?


1 answer

1 accepted

0 votes
Answer accepted

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:

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)



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

250 views 0 12
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