I cloned an open source third-party repository and started working locally, committing to local master.
The remote github repository now has a tag called 8.1.1
Whats the best way to rebase from that remote tag? I want to pull in the latest changes from that release only and then replay my changes on top.
I've done a git checkout tags/8.1.1
but am now in a detached HEAD state
While being on that detached head
pointing to tags/8.1.1
, create a (local) branch at that very place, for example ver_8_1_1
. Then switch to your (local) master and do a normal rebase onto that branch.
git checkout tags/8.1.1 # you are here
git branch ver_8_1_1
git checkout master
git rebase -i ver_8_1_1
Or if you don't want to go around like that, check your commit hash of that detached head (== commit hash of the 811 tag) and then do a rebase onto that directly.
git checkout tags/8.1.1 # you are here, at commit #aabb11223344
git checkout master # ignore your checkout completely
git rebase -i aabb11223344 # just like that
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