It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Import 300+ git repositories to an altassian project

Francois Gervais May 14, 2014

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
Answer accepted
Michael Heemskerk Atlassian Team May 14, 2014

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,653 views 1 18
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you