需要了解Git / Gerrit命令(获取和推送) [英] Need to understand Git/Gerrit command (fetch & push)

查看:313
本文介绍了需要了解Git / Gerrit命令(获取和推送)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  

我的IT部门正在追踪一个例子,我想知道这个命令正在做什么: git fetch origin + refs / changes / *:refs / remotes / origin / changes / *

一些参考框架,这是持续集成(CI)工具的一部分,这是签出要测试的代码的一部分。通过推送到Gerrit触发CI构建:

  git push origin HEAD:refs / for / master 

我的第二个问题是,如果我想将更改推入开发分支,我可以使用:

  git push origin HEAD:refs / for / development 


解决方案

一个典型的补丁将如下所示:
git pull ssh://www.example/com: 29418 / project refs / changes / 24/24/2



这会拉你的项目加上第二个补丁集的变化24.所以,当你把所有可能变化很大的变化拉回来。



我建议您使用Jenkins(CI)加上Gerrit插件,并确保指定选择策略 as Gerrit Trigger 。这将确保你的构建将测试适当的变更集。



是的,你可以推送到开发分支。当然,你需要确保你有正确的权利。最好的方法是首先在Gerrit中创建分支,这样您就不必为创建参考赋予权利,并防止通过拼写错误来错误地创建分支。


I am following an example from our IT department, and I would like to understand what this command is doing exactly:

git fetch origin +refs/changes/*:refs/remotes/origin/changes/*

To give some frame of reference, this is part of a continuous integration (CI) tool, and this is part of the step to checkout the code to test. The CI build is triggered by pushing to Gerrit with:

git push origin HEAD:refs/for/master

I secondary question, is if I wanted to push the change into a development branch could I use:

git push origin HEAD:refs/for/development

解决方案

A typical pull of a patch would look like this: git pull ssh://www.example/com:29418/project refs/changes/24/24/2

This would pull your project plus the second patch set of change 24. So when you pull all the changes that can be a lot.

I would recommend that you use Jenkins (CI) plus the Gerrit plugin and that make sure you specify the choosing strategy as Gerrit Trigger. This will then make sure that you build will test the appropriate change set.

Yes, you can push to a development branch. Of course you need to make sure you have the correct rights. Best is to create the branch in Gerrit first, this way you do not have to give the "create reference" right and prevent creating branches by mistake by spelling mistake for example.

这篇关于需要了解Git / Gerrit命令(获取和推送)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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