Skip to content

cherry-pick into the middle of a branch #5191

@durka

Description

@durka

Is your feature request related to a problem? Please describe.

I want to cherry pick a commit from branch A onto branch B, but not at the tip; it doesn't apply there. I want to paste it further back in the branch.

Describe the solution you'd like

Maybe shift-V should do this, if the cursor isn't at the top of the commit pane? But that's a breaking change, so maybe a new keybinding is needed.

The implementation is: start an interactive rebase, insert pick line(s) with the commit(s) to be cherry-picked, then run it. Or alternatively: roll back the branch to the insertion point, perform the cherry-pick(s), then cherry-pick the subsequent orphaned commits.

Describe alternatives you've considered

I tried starting an interactive rebase with i and then pasting with shift-V, but that just generated a bunch of errors.

I ended up doing it on the CLI by doing git rebase -i and then pasting in pick lines to the todo file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions