I have two gerrit sites. Cherry-pick must be run in a work tree. However, git repositories in gerrit are to be shared, which means cherry-pick is not allowed. I hava many commits in both site. How can I do cherry-picks daily without fetching to many codes locally.
For now I do the following to cherry-pick:
- Clone repository in gerrit A.
- Fetch commit in gerrit B and do cherry-pick in the repository just cloned.
- Push back to gerrit A.
This is not what I want because not nice-looking and slow.
This is why I ask pointing "without fetching to many codes locally".
Note: I want to cherry-pick between bare repositories. A little bit confusing.
This is the only part in my problem I can not explain or change.
One gerrit site has 3 parts: code part, gerrit part, database part. Code part contains all the git repositories presenting on the Gerrit. All of them are created by git init --bare
cmds. These repositories, for most gerrit users, are so-called "remote repositories". Conveniently, you may run the following in bash mkdir temp_dir; cd temp_dir; git init --bare; git status
to check the error print.
Seems that I can do "fetch" in bare repositories.
git fetch ssh://user@server:/project/path.git changes/xx/xxx/x:local_branch
But the change fetched can only been seen in gitweb. Can't review it cause it is not on refs/for branch. How can I fetch a change and get it on refs/for/ branch?