gerrit

gerrit - git (pull vs checkout vs cherrypick) which is for what?

痞子三分冷 提交于 2019-12-02 15:47:26
In Android's gerrit ex: link , to download the patch, I see 4 options. repo download checkout pull cherry-pick What is the difference between them? Here is what I think of them. Please clarify repo download --> Downloads full source code(of all git repos in the project) till this commit checkout --> Not sure what it is. pull --> Not sure what it does? cherry-pick --> It tries to download only this change and merge it into the source code. I know that pull and checkout are different from cherry-pick. But how are they different? Akash Agrawal You are right about the first one. Here are the rest

GitHub, Gerrit, Hudson(Jenkins) workflow

China☆狼群 提交于 2019-12-02 14:44:54
I'm just getting started using GitHub, Gerrit, and Hudson(Jenkins) together. And I need some thoughts on workflow. We'd like to use GitHub as our main remote repo. We'd like to use Gerrit primarily for code reviews, but also for build triggers in Hudson. At the moment, though, I'm having some trouble thinking through the workflow for this and would like to hear what others have done themselves. Thoughts? I haven't directly used Gerrit, but I like the idea of intermediate and specialized repo between: your developer's repos the central GitHub remote repo So you need to determine what you want

Gerrit代码提交冲突

喜欢而已 提交于 2019-12-02 10:41:07
问题背景: 我先在gerrit上进行了一笔提交A,在代码合入等待期间,同事提交并合入了B,此时我的提交A已经造成冲突没有办法合入。 解决方法一: 将代码回退至某一版本 Git reset commitID 若是出现unstaged changes after reset,M app/…. 则 git checkout . Git clean –fd 清楚之前拉下的冲突代码,此时本地代码是上一笔提交时候的代码(期间本地做的修改全部没有了,因此回退之前注意保存) git pull 拉下最新代码 使用beyondCompare对比拉下之后的代码以及自己的保存代码(本地修改的),手动进行对比添加 完成后,提交。Git add. Git commit … git push 解决方法二(待尝试): 直接git pull –rebase拉下本地代码,解冲突 将本地修改直接合入到上一笔提交A上 另外一篇解读git pull --rebase (代码提交与解冲突流程,写的很好,下面是全文) 在使用git的过程中经常需要使用到git pull命令,在更新远端代码的同时如果与本地代码产生冲突了, 那么冲突的文件中就出现了需要手动合并的部分,而git pull --rebase不同的地方则是当有这些冲突存在时, git帮我们自动创建了一个新的分支,并且git告诉你接下来你要在这个新的分支上处理这个冲突,

【Gerrit】Gerrit工作流程及使用手册

房东的猫 提交于 2019-12-02 08:14:29
可以看到test3用户提交的commit_1,因为已经通过审核了,所以,就合并到master中了 我们到当前的目录中,看一下.git文件夹,确实是没有hooks文件夹的 我们通过 scp gerrit:hooks/commit-msg hooks/ 命令来拉取commit-msg文件 同时通过 git config remote.origin.push refs/heads/*:refs/for/* 命令来设置push命令 设置自定义push 虽然我们设置好了push命令到远程的 refs/for/* 目录,但是如果我们直接用SourceTree中的push功能,我们会发现直接给我们在远程新建了一个 refs/for/* 分支,而且gerrit也没有审核事件触发,这是因为sourceTree的push应该是有它自己的一些配置,所以这里我们需要自定义push事件,来完成将代码推送到正确的分支上。 我们进入SourceTree的配置页面 点击 Custom Actions ,然后输入命令的名字: push to gerrit Script to run: 指的是要执行的文件,我们这里把git的可执行文件目录放进来,如果是windows请自行找到该目录 Parameters 就直接写入 push ,表示执行的是push命令 最后当我们要通过推送到gerrit服务器时,在当前的分支上,右键

What to do, when missed some key refs during push to Gerrit

主宰稳场 提交于 2019-12-02 05:28:02
问题 I'm new to Git and even newer to Gerrit and got a little bit lost. My workflow was probably standard: create a new branch, do the magic , commit changes, push them to Gerrit's repo. My newly pushed branch is visible in Gerrit's web UI, but change is not visible at all. After reading this answer, Gerrit's docs and many more, I easily and quickly found, that I missed magical refs. Instead of git push origin HEAD:refs/for/{branch name} I did just git push origin . Great! But, how to recover from

【Git & Repo & Gerrit 】

你。 提交于 2019-12-02 04:05:57
Repository 使用GIT管理一个项目的时候,就需要一个仓库(repository)用于存放GIT对项目管理所必须要保存的各种文件,使用 git init 命令创建一个新的仓库。GIT会在当前目录下创建一个.git文件夹,用作仓库。然后,当你使用GIT记录每一次代码改动的时候,GIT就会把需要的信息都放到这个文件夹下面。 Commit 每当你完成一个改动(change)的时候,就可以commit一下,记录当前项目的情况(snapshot)。每一个commit包含如下信息: commit-id(sha-id) :这是一个通过sha-1算法算出来的一个id,它不只作为每个commit的唯一识别码,也可以用来验证保存的代码是否损坏。所以在GIT在管理代码的时候,如果发生代码损坏,可以很有效的检测到。 author :作者 date : 日期时间 log messge :一段作者对代码改动的文字描述。 change-id :如果是和repo、gerrit一起使用的话,repo会加上这个信息,以便在整个代码系统中识别同一个改动的多个版本。 用代码管理软件管理代码的时候,有个理念就是:每次改动提交以后,整个项目都应该是可以工作的。所以,每次commit最好都能是这样的的改动,虽然这不是必须的,但是这样对项目整体质量的提高很有好处。 在GIT使用中

{翻译} repo Manifest Format 【repo清单格式】

邮差的信 提交于 2019-12-02 02:57:55
源文件: 0c957dd542b1476b34f3ad37736b06df38ea2fa8 repo清单格式 repo清单描述了repo客户端的结构;这是可见的目录,并且是git应该能够获取的目录。 清单的基本结构是一个裸Git存储库,但是在顶级目录中包含一个'default.xml'XML文件。 清单本身就是版本控制的,因为它们保存在Git存储库中。客户在 repo sync 期间自动获取清单更新。 XML文件格式 清单XML文件(例如'default.xml')大致符合以下DTD: <!DOCTYPE manifest [ <!ELEMENT manifest (notice?, remote*, default?, manifest-server?, remove-project*, project*, extend-project*, repo-hooks?, include*)> <!ELEMENT notice (#PCDATA)> <!ELEMENT remote EMPTY> <!ATTLIST remote name ID #REQUIRED> <!ATTLIST remote alias CDATA #IMPLIED> <!ATTLIST remote fetch CDATA #REQUIRED> <!ATTLIST remote pushurl CDATA

What to do, when missed some key refs during push to Gerrit

烂漫一生 提交于 2019-12-01 22:48:44
I'm new to Git and even newer to Gerrit and got a little bit lost. My workflow was probably standard: create a new branch, do the magic , commit changes, push them to Gerrit's repo. My newly pushed branch is visible in Gerrit's web UI, but change is not visible at all. After reading this answer , Gerrit's docs and many more, I easily and quickly found, that I missed magical refs. Instead of git push origin HEAD:refs/for/{branch name} I did just git push origin . Great! But, how to recover from this situation? Whenever I try to push again, this time with proper refs, I'm getting ! [remote

Multiple devs pushing to same change

一笑奈何 提交于 2019-12-01 17:53:30
I'm struggling to find a good workflow when two or more people are pushing patch-set's to the same change-set in Gerrit. I am trying to accomplish this with command-line Git commands (no git-review, IDE, etc). Pulling down the latest patch-set from the Gerrit server for a particular change is easy enough, but from there I'm not sure. I would think the process would be: fetch latest patch-set for change from server rebase against latest patch-set push But during the rebase it marks all incoming changes as conflict, even if they weren't altered locally. Perhaps this is related to the fact that

Can I specify .git/config values in a repo

泪湿孤枕 提交于 2019-12-01 11:29:07
I have a git repo that requires a number of atypical settings. I'd like to set it up so that when people clone my repo and work with branches they don't have to follow a list of steps. But I also don't want to get in the way of dealing with other repos they work with, possibly even in the same project. I want git config remote.<remote>.push HEAD:/refs/for/something git config branch.<branch>.merge refs/head/something (where branch's remote is <remote> ) Is there some way to configure this so that just by cloning the repo everything is set up properly? There isn't. That's intentional. Your repo