I'm trying to cherry pick a commit from github.
https://github.com/angular/angular.js/commit/469b750019adb193f2b973ab841ac87d0d06d4f2
As far as I can tell, it isn't a part of any active branches. I tried this in my local repo:
git remote add upstream https://github.com/angular/angular.js.git
git fetch upstream
git cherry-pick 469b750
I get this error
fatal: bad revision '469b750'
Is what I'm trying to do possible? I searched for lost, orphaned, and branchless commits, but I didn't find anything that helped. I could just copy/paste this and be done with it, but I'm trying to keep the history and learn more about git. Thank you.
It will not be exactly cherry pick, but you can apply this commit as follows:
Add .patch
to Github URL and save it as git patch file:
wget https://github.com/angular/angular.js/commit/469b750019adb193f2b973ab841ac87d0d06d4f2.patch -o new.patch
Apply this commit to your tree with git am
:
git am new.patch
Outcome of this should be identical to cherry-picking.
That's a really interesting problem. I was testing it locally myself and the commit doesn't appear in reflog --all
so it is not only orphaned but it's not downloaded from Github on a pull, clone or fetch.
It may be a case that it's totally lost forever unless you download it manually and put it back in the tree.
https://help.github.com/articles/commit-exists-on-github-but-not-in-my-local-clone/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With