Description 724 -> 214 chars, body 1102 -> 343 words, Gotchas 12 -> 3. Create, rewrite, and cherry-pick flows move to self-contained references/ files behind a dispatch table. The audit caught that moving the secret scan into the create flow left the amend/squash path with no check in its loaded context; it is now a gate common to every flow. Also re-homes the interactive-rebase reflog warning git-history dropped, since this skill owns rebase.
13 lines
747 B
Markdown
13 lines
747 B
Markdown
---
|
|
source_keys:
|
|
- context7-git-htmldocs
|
|
---
|
|
|
|
# Cherry-picking a commit
|
|
|
|
1. **Identify the source commit** — a hash or a branch reference.
|
|
2. **Confirm the destination** — cherry-pick replays onto the branch currently checked out, so verify that is the intended branch before running anything.
|
|
3. **Execute** — `rtk git cherry-pick <commit-hash>`. A range is `<a>..<b>` (exclusive of `<a>`) or `<a>^..<b>` (inclusive); `-n` stages without committing, for when the replay needs editing first.
|
|
4. **Handle conflicts** — if the replay halts, offer resolution or `rtk git cherry-pick --abort`. Never resolve automatically without confirmation.
|
|
5. **Report the outcome** — which commits replayed, which conflicted, and which were rejected.
|