Cherry-pick & Tags
git cherry-pick
Grab one specific commit from another branch and apply it to your current branch - without merging the whole branch.
$ git cherry-pick a1b2c3d
Scenario: A bug fix landed on thedevelopbranch, but production (main) needs just that fix - not everything else on develop.cherry-pickcopies that single commit over.
Tags - marking releases
Tags are permanent labels on a commit, used for version releases (v1.0.0).
| Command | Does |
|---|---|
git tag v1.0.0 | Lightweight tag on current commit |
git tag -a v1.0.0 -m "Release 1.0" | Annotated tag (recommended) |
git tag | List tags |
git push origin v1.0.0 | Push a tag (tags aren't pushed by default) |
Tip: Tags are not pushed automatically - remembergit push origin <tag>(orgit push --tags) or your release marker stays local.