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

1 vote
Accepted answer

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.

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 "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
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

678 views 5 9
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