{"record":{"id":"d04a203b827c81c7","repo":"jesseduffield/lazygit","slug":"you-are-currently-neither-rebasing-nor-merging","errorCode":null,"errorMessage":"You are currently neither rebasing nor merging","messagePattern":"You are currently neither rebasing nor merging","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/gui/controllers/helpers/merge_and_rebase_helper.go","lineNumber":101,"sourceCode":"\t// spin up a worker (via the waiting status below) to do the actual work.\n\treturn self.genericMergeCommandImpl(command, true, false)\n}\n\n// genericMergeCommandImpl runs a merge/rebase continue/skip/abort and handles\n// the result. Continuing can be slow (it may replay many commits), so the\n// non-subprocess path runs on a worker with a waiting status.\n//\n// showWaitingStatus is false only for the recursive auto-skip in\n// CheckMergeOrRebaseWithRefreshOptions, which already runs on a worker, so it\n// must not spin up a second waiting status. calledFromWorker is used only by the\n// subprocess path below: it's true for that recursive worker skip and false for\n// genericMergeCommand's UI-thread invocation, so the post-action refresh picks\n// RefreshFromWorker vs Refresh correctly.\nfunc (self *MergeAndRebaseHelper) genericMergeCommandImpl(command string, showWaitingStatus bool, calledFromWorker bool) error {\n\tstatus := self.c.Git().Status.WorkingTreeState()\n\n\tif status.None() {\n\t\treturn errors.New(self.c.Tr.NotMergingOrRebasing)\n\t}\n\n\tself.c.LogAction(fmt.Sprintf(\"Merge/Rebase: %s\", command))\n\teffectiveStatus := status.Effective()\n\tif effectiveStatus == models.WORKING_TREE_STATE_REBASING {\n\t\ttodoFile, err := os.ReadFile(\n\t\t\tfilepath.Join(self.c.Git().RepoPaths.WorktreeGitDirPath(), \"rebase-merge/git-rebase-todo\"),\n\t\t)\n\n\t\tif err != nil {\n\t\t\tif !os.IsNotExist(err) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tself.c.LogCommand(string(todoFile), false)\n\t\t}\n\t}\n","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/gui/controllers/helpers/merge_and_rebase_helper.go#L83-L119","documentation":"Returned by MergeAndRebaseHelper.genericMergeCommandImpl when an abort/continue/skip-style merge-or-rebase command is requested but WorkingTreeState() reports neither a merge nor a rebase in progress (status.None()). The function is the single funnel for generic 'git merge/--continue/--abort' and 'git rebase --continue/--abort/--skip' dispatch, so it guards up front that a state machine actually exists to act on.","triggerScenarios":"Pressing the continue/abort/skip merge-rebase keybindings (e.g. 'm' menu options or 'M' conflicts keys) after the merge/rebase already finished — typically because another process, an auto-refresh race, or the user completed it elsewhere — leaving no MERGE_HEAD or rebase-merge directory.","commonSituations":"Stale UI after a rebase finished in a terminal; race where lazygit's status refresh lags the actual repo state; double-pressing continue; a worktree where the rebase was aborted externally.","solutions":["Refresh lazygit (r) — usually the merge/rebase state shown is stale and the option should not have been offered.","If a merge/rebase really is expected, verify with 'git status' in a terminal (look for MERGE_HEAD or .git/rebase-merge).","If genuinely finished, just proceed with normal work; there is nothing to continue or abort."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// guard before invoking continue/abort/skip:\nif self.c.Git().Status.WorkingTreeState().None() {\n    // state already resolved: refresh instead of dispatching a generic command\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Refresh (r) after finishing a rebase externally before using conflict keys","Avoid double-pressing continue; wait for the refresh between presses"],"tags":["git","merge","rebase","state-machine","race"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}