kuttu
kuttu

Reputation: 55

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

1) git remote add <RepoName> <repoURL>

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

3) 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.

Upvotes: 5

Views: 1601

Answers (1)

ryenus
ryenus

Reputation: 17381

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:

https://github.com/DespairFactor/N6/commit/ecea4ab6d3d8bb4122522398200f1cd2a06af6d5.patch

And some variant forms:

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

Upvotes: 6

Related Questions