Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git cherry pick from remote master branch without other remote changes

Let's say I am working on my master in my own repository. My upstream for example is main-upstream.

But I need one specific commit from another remote - special-upstream. I don't want another changes from it - I do not need all commits from that remote and I don't want any changes from it - it's a different project - except one certain commit with certain hash from branch master.

Is it possible to cherry-pick it?

like image 426
lapots Avatar asked Feb 09 '26 19:02

lapots


1 Answers

Add the other repo as a remote and fetch it's commits:

git remote add otherremote <url to other remote>
git fetch otherremote

Cherry pick the commit from the other repo

git cherry-pick <sha1 from otherremote>

This will cherry-pick the selected commit into the current branch.

like image 157
joran Avatar answered Feb 12 '26 15:02

joran



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!