Kong/insomnia · error
There are uncommitted changes on current branch. Please…
Error message
There are uncommitted changes on current branch. Please commit them before merging.
What it means
Precondition guard in GitVCS.merge: the working tree has uncommitted changes and allowUncommittedChangesBeforeMerge is false, so merging is refused to avoid losing work. Commit or stash changes first (or pass the allow flag).
Solutions
- Commit or stash local changes, then retry the merge
- Pass allowUncommittedChangesBeforeMerge when the caller explicitly accepts the risk
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/insomnia/src/sync/git/git-vcs.ts:1897 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26).
Data as JSON: /api/errors/cc158d84f9f2734a.
Report an issue: GitHub.
Appendix: source
Thrown at packages/insomnia/src/sync/git/git-vcs.ts:1897
await git.commit({
...this._baseOpts,
message: commitMessage,
parent: commitParent,
});
}
async merge({
theirsBranch,
allowUncommittedChangesBeforeMerge = false,
}: {
theirsBranch: string;
allowUncommittedChangesBeforeMerge?: boolean;
}) {
if (!allowUncommittedChangesBeforeMerge) {
const hasUncommittedChanges = await this.hasUncommittedChanges();
if (hasUncommittedChanges) {
throw new Error('There are uncommitted changes on current branch. Please commit them before merging.');
}
}
const oursBranch = await this.getCurrentBranch();
console.log(`[git] Merge ${oursBranch} <-- ${theirsBranch}`);
const writeFileMap = {};
if (
'startCollectWriteAction' in this._baseOpts.fs &&
typeof this._baseOpts.fs.startCollectWriteAction === 'function'
) {
this._baseOpts.fs.startCollectWriteAction(writeFileMap);
}
return git
.merge({
...this._baseOpts,
ours: oursBranch,
theirs: theirsBranch,
abortOnConflict: false,
})View on GitHub (pinned to d9bb2b0142)