docs: add cherry-picking guide to git workflow scenarios#115518
Open
lazizbekravshanov wants to merge 1 commit intofirstcontributions:mainfrom
Open
docs: add cherry-picking guide to git workflow scenarios#115518lazizbekravshanov wants to merge 1 commit intofirstcontributions:mainfrom
lazizbekravshanov wants to merge 1 commit intofirstcontributions:mainfrom
Conversation
Add a beginner-friendly guide explaining git cherry-pick: - When cherry-picking is the right tool (hotfix onto a release branch, moving a commit off the wrong branch) and when it isn't (a full merge would be simpler; the commit is already in your history). - Finding a commit's short hash with `git log --oneline`. - Cherry-picking a single commit and a range. - Resolving conflicts with --continue / --abort, cross-linking to resolving-merge-conflicts.md. - A short note on duplicate-history surprises that can come from later merging the source branch in. Index entry added to additional-material.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a beginner-friendly guide for
git cherry-pick, matching the style of the existing scenario guides (e.g.squashing-commits.md,resolving-merge-conflicts.md).Cherry-picking is one of the operations new contributors most commonly encounter once they're past their very first PR — a maintainer asks them to pull a hotfix onto a release branch, or they've accidentally committed to the wrong branch and need to move one commit. The repo already has scenario guides for adjacent operations (squashing, reverting, merging, resolving conflicts) but nothing on cherry-pick.
Note on contribution workflow
.github/CONTRIBUTING.mdsays: "If you'd like to suggest a change in the tutorials or the workflow, please raise an issue. We can have a discussion to better understand the problem, get more people involved and make a collective decision."I'm happy to close this PR and open an issue first if that's the maintainers' preferred flow for new content — just say the word. I wrote this directly as a PR because having something concrete to review usually makes the "is this worth having?" conversation faster, but I don't want to skip a process you have for good reasons.
What the guide covers
git log --oneline.a^..binclusive-range syntax).--continue/--abort, with a cross-link toresolving-merge-conflicts.md.Index entry added to
additional-material.mdunderCherry-picking a commit.Test plan
resolving-merge-conflicts.mdresolves.🤖 Generated with Claude Code