gerrit - git(pull vs checkout vs cherrypick)这是为了什么? [英] gerrit - git (pull vs checkout vs cherrypick) which is for what?
问题描述
在Android的gerrit ex:链接中,要下载该补丁,我会看到4个选项。
- 回购下载
- 结帐
- >
- cherry-pick
它们之间的区别是什么?
这是我对他们的看法。请澄清
- 回购下载 - >下载完整源代码(项目中的所有git回购)直到此次提交 $
- 结账 - >不确定它是什么。
- pick - >它试图只下载这个改变并将它合并到源代码中。
我知道pull和checkout是不同的从樱桃采摘。但它们又有什么不同?
你是对的第一个。以下是其他人: 结帐 :获取最新更改。你应该已经有这个回购下载。它不会合并这些新更改,但会使您的工作目录反映它们。您可以稍后将它们合并。 拉 :提取更改并将它们合并到同名的本地分支中
$ b
git
中的实际含义。 checkout
和 cherry-pick
不会自动获取更改。 checkout
只需将 HEAD
指定给您的提交,从而使工作目录与提交时的工作目录完全相同。同样, cherry-pick
用于重放您已有本地访问权限的提交。
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?
You are right about the first one. Here are the rest of them:
Checkout: Fetches the latest changes. You should already have this repo downloaded. It does not merge those new changes but makes your working directory reflect them. You can merge them at your leisure later.
Pull: Fetches the changes AND merges them into the local branch of the same name.
Cherry-pick: Fetches the commit and plays it on top of the current local branch, thus creating an entirely new commit which happens to have same changes as the one it fetched.
They are a little different than what they actually mean in git
. checkout
and cherry-pick
don't automatically fetch the changes. checkout
just takes HEAD
to a commit you specify, thus making working directory exactly as it was at that commit. Likewise, cherry-pick
is used to replay commits which you already have local access to.
这篇关于gerrit - git(pull vs checkout vs cherrypick)这是为了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!