In Android’s gerrit ex: link, to download the patch, I see 4 options.
- repo download
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. And a name-less commit is created to include these changes in your working directory. And a detached HEAD pointing to it. 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
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.
Answered By – Akash