This error occurs when Git detects an unfinished cherry-pick operation. You must complete, skip, or abort the in-progress cherry-pick before starting a new one or performing certain other Git operations.
When you run `git cherry-pick` on one or more commits, Git uses a mechanism called the "sequencer" to track the operation's progress. This sequencer stores state information in the `.git/sequencer` directory and creates a `CHERRY_PICK_HEAD` file in `.git/` that points to the commit being cherry-picked. If the cherry-pick encounters conflicts, gets interrupted, or you simply forget to finish it, Git leaves these state files in place. When you then try to start another cherry-pick, perform a rebase, or run certain other Git commands, Git detects the existing sequencer state and refuses to proceed with the error "there is a cherry-pick in progress." This is a safety featureβGit is protecting you from creating a confusing state where multiple operations overlap. The solution is to explicitly tell Git what to do with the in-progress operation: continue it, skip the problematic commit, abort the entire operation, or quit while keeping partial changes.
First, understand what's happening with the in-progress cherry-pick:
git statusThis will show you:
- Which commit is being cherry-picked
- Whether there are unresolved conflicts
- What files are in conflict or staged
You can also see the commit being cherry-picked:
git log -1 CHERRY_PICK_HEADIf you want to complete the cherry-pick and you've already resolved any conflicts:
1. Stage your resolved files:
git add <resolved-files>
# Or stage all:
git add .2. Continue the cherry-pick:
git cherry-pick --continueGit will create the commit and proceed to the next commit in the sequence (if any).
If you want to skip the problematic commit and continue with the remaining commits in a multi-commit cherry-pick:
git cherry-pick --skipThis skips the current commit and moves to the next one. Useful when:
- The commit results in an empty change (already applied)
- You've decided this particular commit isn't needed
- The conflicts are too complex to resolve
Note: This option was added in Git 2.23 (August 2019).
If you want to cancel the cherry-pick and return to your original state before it started:
git cherry-pick --abortThis will:
- Remove all cherry-pick sequencer state
- Restore your working directory to its pre-cherry-pick state
- Undo any partial commits made during the cherry-pick sequence
This is the safest option if you're unsure what to do.
If you want to stop the cherry-pick but keep the commits that were successfully applied:
git cherry-pick --quitThis is different from --abort:
- --abort undoes everything and returns to the original state
- --quit stops the operation but keeps successful commits
Use --quit when you've successfully cherry-picked some commits and want to keep them, but don't want to continue with the remaining ones.
Sometimes after resolving conflicts, the cherry-pick results in no changes (the commit was already applied or conflicts resolved to match existing code). Git will show:
The previous cherry-pick is now empty, possibly due to conflict resolution.You have two options:
1. Skip this empty commit:
git cherry-pick --skip2. Or commit it anyway as an empty commit:
git commit --allow-emptyIn most cases, skipping is the right choice.
If the above commands don't work, you can manually remove the sequencer state files:
# Remove the cherry-pick head reference
rm -f .git/CHERRY_PICK_HEAD
# Remove the sequencer directory
rm -rf .git/sequencerWarning: Only do this if the standard commands fail. This forcefully clears the state without properly cleaning up, which could leave your repository in an unexpected state.
After manual cleanup, run:
git status
git reset --hard HEAD # Only if needed to clean working directory### Understanding the Git Sequencer
The sequencer is Git's mechanism for managing multi-step operations like cherry-pick and revert. When you run git cherry-pick A B C (cherry-picking multiple commits), Git stores the list of remaining commits in .git/sequencer/todo and processes them one by one.
Key files involved:
- .git/CHERRY_PICK_HEAD: Points to the commit currently being cherry-picked
- .git/sequencer/head: The original HEAD when the sequence started
- .git/sequencer/todo: List of commits remaining to be processed
- .git/sequencer/abort-safety: Safety file for abort operation
### Cherry-Pick vs Revert Conflicts
Both cherry-pick and revert use the same sequencer. If you see "a cherry-pick or revert is already in progress," check which operation is actually active:
git statusThe output will specify whether you're in a cherry-pick or a revert.
### Preserving Author Information
When you complete a cherry-pick with --continue, Git preserves the original commit's author information (name, email, and author date). The committer will be you, but the author remains the original commit's author.
If you manually remove .git/CHERRY_PICK_HEAD and commit, this author information is lost.
### Git Version Differences
- --abort and --continue: Available since Git 1.7.8 (December 2011)
- --quit: Available since Git 2.19 (September 2018), but had a bug where it didn't remove CHERRY_PICK_HEAD until later fixes
- --skip: Available since Git 2.23 (August 2019)
If you're on an older Git version, you may need to use manual cleanup methods or upgrade Git.
warning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
fatal: Server does not support --shallow-since
Server does not support --shallow-since in Git
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server