Reputation: 709
I have a scenario. I have two instances, instance 1 for Gerrit and instance 2 for Git. I want to understand how will git intercept the requests coming directly to instance 2?
It can be safely assumed that I have to install gerrit only remotely, and not on the git instance.
While initializing gerrit, the interactive cli screen asks for the git repository location which is supposed to be a local(?) directory, like /home/me/git-repo (inside git-repo I have my project.git files). What if instead of a local repository, I specify a remote repository URI, say ssh://[email protected]/root/project.git, first of all, will it work? If yes, how it is really intercepting all the push,pull... requests coming to ssh://[email protected]/root/?
Upvotes: 1
Views: 988
Reputation: 141
This is possible. First understand that gerrit is going to act as a staging workplace for your remote git. Which means that when a user submits the patch-set it first needs to go to Gerrrit's git workspace. Typically $GERRIT_HOME/git/. Now one need to enable replication in order to sync this repo to the remote git server where they want to submit the code eventually. Some useful link on replication setup and git projects setup can be found here:
https://review.typo3.org/plugins/replication/Documentation/config.html
Importing already existing git repo with multiple branches and tags into gerrit
Sample replication.config which may help you:
[remote "github-remote-name"]
url = git@<remote-git-server>/${name}.git
Keep in mind that this ${name} is a magic keyword which is required to be matched with the repo that you want to sync. In order to sync selective repos of many that you may have, follow the guidelines in the link above.
Hope this helps.
Upvotes: 1