Skip to content

Error when cherry-picking a merge commit #1374

@guban

Description

@guban

Describe the bug
Cherry-picking a merge commit results in error Rebasing (1/1)error: commit ... is a merge but no -m option was given.

To Reproduce

Try cherry-picking any merge commit, or use this script to create a test git repo with a merge commit that is ready to be cherry-picked:

@echo off

git init

echo v1 > a.txt
git add a.txt
git commit -m v1

:: We will cherry-pick our merge commit to branch "release".
git branch release

:: Add the "work" branch with a couple of commits.
git checkout -b work
echo v2 > a.txt
git add a.txt
git commit -m work2
echo v3 > a.txt
git add a.txt
git commit -m work3

:: Merge "work" into "main". Use "--no-ff" to force creating a new merge commit.
git checkout main
git merge --no-ff work

:: Switch to the "release" branch.
git checkout release

echo Now, open lazygit and cherry-pick the merge commit from the "main" branch to "release" branch.

Actual behavior: lazygit shows an error message Rebasing (1/1)error: commit ... is a merge but no -m option was given.

Expected behavior
The merge commit is expected to be cherry-picked without any errors.

Desktop (please complete the following information):

  • OS: Windows 10
  • Lazygit Version v0.28.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions