user2039831
user2039831

Reputation:

Need to copy a particular Git commit from another repository

I am new to git

I need to get this commit https://github.com/DJNoXD/candied-kernel/commit/3a9f10b82d9a5b6dc54ceab4d7edb60c5a7f19e6

to my git https://github.com/nayak94/nayak-kernel/commits/0.1

I have no clue what to do, any help would be greatful

Upvotes: 1

Views: 66

Answers (1)

Michael Wild
Michael Wild

Reputation: 26331

This should do the trick:

git remote add candied-kernel [email protected]:DJNoXD/candied-kernel.git
git fetch candied-kernel master
git cherry-pick 3a9f10b

If it's a one-off thing, you might want to download the patch file instead by appending .patch to the URL (i.e. https://github.com/DJNoXD/candied-kernel/commit/3a9f10b82d9a5b6dc54ceab4d7edb60c5a7f19e6.patch) and then use

git am /path/to/3a9f10b82d9a5b6dc54ceab4d7edb60c5a7f19e6.patch

Upvotes: 4

Related Questions