Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Mirror GIT repo to stash

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 18, 2013

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

1 vote
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 24, 2013

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

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 29, 2013

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

0 votes
Rajan M December 4, 2013

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.

cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 4, 2013

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

0 votes
Harry Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 19, 2013

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.

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 19, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events