Mirror GIT repo to stash

We want to run an evaluation of Stash, and compare it with Gerrit - which is currently 'managing' the central GIT repo.

To be able to do so, we need to pull all changes pushed to the gerrit repo into stash.
What would be the best approach ?

3 answers

1 accepted

This widget could not be displayed.

Hi Francis,

It partly depends on whether you want the canonical source to be in Gerrit or Stash. You can't really have people pushing to both at the same time, as you'll quickly run into merge problems. In any case you probably want a post-receive script on the primary host to push to the secondary host. (You could do this as a Stash plugin, but that might be more effort at this stage). I haven't done this personally, but you might be able to setup replication in Gerrit to do that for you.

Longer term we plan on implementing mirroring in Stash which would help with situations like this.




The canonical source would be Gerrit.
Thanks for the replication hint.

This widget could not be displayed.

Hi, how do you want it setup? Do you just want the initial clone or more than that? Otherwise, I'd just clone it to Stash using the tools available or an IDE etc.

No - it should synchronize (ie. a git pull everything something is pushed on the other repo)

This widget could not be displayed.

Hi charles,

we are looking for similar solution where we need to mirror the GitHub repository in internal Stash instace. Internal stash instance will be pulling and pushing the changes (to and from) the GitHub repo. I tried using Mirror plugin but it's not able to mirror. Following is from the log file.

2013-12-05 09:54:22,649 WARN [threadpool:thread-12] admin 593x583x0 j06sbv "PUT /rest/api/latest/projects/IOP/repos/pfmt.io/settings/hooks/com.englishtown.stash-hook-mirror%3Amirror-repository-hook/settings HTTP/1.1" c.e.stash.hook.MirrorRepositoryHook Failed to mirror repository PFMT.IO, retrying in 1 minute (attempt 2 of 5).

2013-12-05 09:55:23,805 DEBUG [threadpool:thread-12] admin 593x583x0 j06sbv "PUT /rest/api/latest/projects/IOP/repos/pfmt.io/settings/hooks/com.englishtown.stash-hook-mirror%3Amirror-repository-hook/settings HTTP/1.1" com.atlassian.stash.scm.BaseCommand Executed /usr/bin/git push --prune https://mraviraj:<password>@github.com/theAIteam/PFMT.IO +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/*

I have the push access to GitHub Repo and I am able to do it with my local instance.

Hi Rajan,

I'm couldn't say what's wrong as we didn't write that plugin. You might want to leave a question on Marketplace where the vendor can see it; they seem to have responded to others in the past.



Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 10, 2018 in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

244 views 14 2
Join discussion

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