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

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.

https://jira.atlassian.com/browse/STASH-2714

Cheers,

Charles

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

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)

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 10.4.12.92 "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 10.4.12.92 "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.

Cheers,

Charles

Suggest an answer

Log in or Join to answer
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...

717 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot