根据github项目获取本地gerrit和存储库工作(包括分支机构) [英] Getting local gerrit and repository working (including branches) based on a github project

查看:101
本文介绍了根据github项目获取本地gerrit和存储库工作(包括分支机构)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的目标是基于使用git和gerrit在外部回购(github)上托管的项目进行内部开发。我们将定期从外部回购协议中引入新的变更和分支机构,并使用gerrit来管理审核流程(并且Jenkins将全部构建)。我们的初始过程是通过git从外部repo克隆到本地repo,然后在gerrit中创建一个空项目,最后将本地克隆推送到gerrit。



到那时但是,我们在gerrit repo中看不到任何分支!现在我们正在通过手动添加分支和refids来解决这个问题,但这似乎令人费解和脆弱。我认为外部分支会默认进入,没有额外的扭曲。他们当然是从github repo制作的克隆中的。



理想情况下,能够从github直接克隆到gerrit并使其正常工作会更好。 ..不清楚为什么额外的本地回购仅仅是为了转移东西而必需的,或者为什么当本地克隆被推向它时,分支没有出现在gerrit克隆中。建议?

解决方案

当您执行git push时,它只会推动活动分支(HEAD)。如果您希望推送所有分支和标签,请执行 git push origin refs / heads / * --tags



在推送到Gerrit之前,在技术上不需要存储库的本地副本,但它可能是最简单的方法。


Our goal is to do internal development based on a project hosted on an external repo (github) using git and gerrit. We would pull from the external repo periodically to bring in new changes and branches, and use gerrit to manage the review process (and Jenkins to build it all).

Our initial process is to clone from the external repo to a local repo via git, then create an empty project in gerrit, and finally push the local clone to gerrit.

At that point, however, we see no branches in the gerrit repo! Right now we're working around that by manually adding the branched and refids, but that seems convoluted and fragile. I'd think the external branches would come in by default, without extra contortions. They are certainly in the clone made from the github repo.

Ideally, it'd be nice to be able to clone straight from github to gerrit and have it just work... it's not clear why the extra local repo is necessary simply to transfer things, or why branches aren't appearing in the gerrit clone when the local clone is pushed to it. Suggestions?

解决方案

When you perform a git push, it only pushes the active branch (HEAD). If you wish to push all branches and tags, do something like git push origin refs/heads/* --tags

It isn't technically required to have a local copy of the repository before pushing to Gerrit, but it is probably the easiest method.

这篇关于根据github项目获取本地gerrit和存储库工作(包括分支机构)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆