Bulk adding GIT Repositories?


we want to add 300+ Projects to the GIT Plugin. Is there a way to do this via cmdline/curl/sql ?



7 answers

1 accepted

2 votes
Answer accepted


This curl command works for me:
curl \
	-u admin:admin  \
	-X POST \
	--data "displayName=test2&root=/home/andrey/work/dmd/test-repo&enableFetches=true&origin=git@github.com:AndreyLevchenko/test-repo.git&revisionIndexing=true&revisionCacheSize=10000" \

That worked for me, thanks! I wrapped it in a little quickie script using my local gitolite server as origin (sanitized):


#Given a directory full of directories full of repos, fx ./frontend_repos/{repo1,repo2,repo3} and ./backend_repos/{repoA,repoB,repoC}

for dir in frontend_repos backend_repos
  cd $dir
  ls -C1| while read i
    echo "$dir --  $i"
    curl -u admin:password -X POST --data "displayName=$i&root=/home/jira/git/$dir/$i&enableFetches=true&origin=gitolite@my.domain.net:$dir/$i.git&revisionIndexing=true&revisionCacheSize=10000" http://localhost:8080/jira/secure/AddGitRepository.jspa
  cd ..

Jim - we're looking at a UI for this functionality. If we decide to proceed with development, I will update here with progress. Cheers!

Good to hear. The plugin otherwise does exactly what we need, this would be icing on the cake.

Did you ask people who are developing that plugin ? There is a link to Support and Issues which might help.

Thanks Andrey and Eric, you saved me a lots of work! Script works like a charm

It's great we have a workaround, but is there any chance this can become part of the product? I don't mind getting my hands dirty but it would be much cleaner to do it through the admin UI.

Updating this old conversation as we have added a number of APIs and functionality for admins to add large numbers of repositories: https://bigbrassband.com/api-doc.html

Any questions can be directed to support@bigbrassband.com.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


246 views 0 6
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