kuttu kuttu - 10 months ago 38
Git Question

git cherry-pick without fetching remote branch

I am having a bit of a problem here, I want to cherry-pick a commit from a git repo that isn't locally present in my system.

For example : https://github.com/DespairFactor/N6/commit/ecea4ab6d3d8bb4122522398200f1cd2a06af6d5

A usual cherry-picking procedure includes doing


git remote add <RepoName> <repoURL>

git fetch <RepoName>
and it downloads a copy but isn't merged to your own local repo.

git cherry-pick <commit SHA>
and cherry-pick is done.

I have a very slow download speed (1 mbps), and I don't have enough time to download whole repo for 1 commit. Sorry if this question was already asked and answered.


You might consider to download the patch, then apply it locally.

To get the patch for a specific commit on GitHub, simply append the .patch suffix to the commit URL:


See: https://github.com/blog/967-github-secrets#diff-patch