Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
To cherry pick from head and commit back into a tag
-from master in working branch
>> git branch [new branch] [tag]
>> git checkout [branch]
-pull commit out and add it to the commit at the top of the tag
>> git cherry-pick [commit] or git cherry-pick [firstcommit]^..[lastcommit] if you have a range
-resolve conflicts
-delete the local tag
>> git git tag -d [tag]
-add a new tag at the head of the old one
>> git tag [tag]
-delete the remote tag
>> git push origin :[tag]
-push new tag and commits
>> git push origin [tag]
ex.
git branch a release_a
git checkout a
git cherry-pick 899a25202dbf8bdb58fc73ae836f50660ec0b23b
git tag -d release_a
git tag release_a
git push origin :release_a
git push origin release_a
@robwithhair

This comment has been minimized.

Copy link

commented Mar 24, 2015

Very handy, thanks for publishing this.

@davilima6

This comment has been minimized.

Copy link

commented Feb 6, 2016

Ty!

@antenore

This comment has been minimized.

Copy link

commented Aug 17, 2016

Thanks a lot! Forked and adapted to my case. Ty! Ty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.