On this page
conclude a merge git stopped before committing.
#safegit merge-continue
conclude a merge git stopped before committing. Every conflicted path is named with --resolve (or in a --resolve-file), and safegit writes the merge commit itself: HEAD plus the MERGE_HEAD line as parents; the merge's whole staged result as its tree, so a path the merge staged cleanly is never dropped; git's own message draft with its comment block stripped, or -m; the repository's commit-msg hook run and safegit's trailers injected; and the merge's whole state-file set removed afterwards, so a later commit is not refused. An empty merge needs no flag -- a merge commit records its parents whether or not the tree changed. Two merge shapes only raw git can start are REFUSED, each naming git's own 'merge --continue' and '--abort': an OCTOPUS, because every check safegit makes over a merge is written against two sides, and a content conflict git recorded with no AUTO_MERGE, which is a non-default strategy's signature and leaves the marker verification nothing to read
Effect: mutating
#Flags
| Name | Short | Type | Presence | Env | Description |
|---|---|---|---|---|---|
--resolve | list[str] | optional | resolve one conflicted path, as 'path=ours|theirs|worktree|delete' (repeatable, once per path; the split is on the last '=', so a path containing one stays intact). The keywords are defined by INDEX STAGE: ours is the stage-2 blob -- the content this branch already had, before the merge; theirs is the stage-3 blob -- the content merged in from the other side; worktree is the file's current content on disk; delete leaves the path out of the commit. ours and theirs also WRITE the chosen content into the working tree (git's own checkout --ours), and delete removes the file from disk (git's own rm). Paths are repository-relative. Omitted, every conflicted path is unresolved, which is a refusal listing them | ||
--resolve-file | str | optional | read resolutions from a TOML file of [[resolutions]] tables, each with a path and a choice key; combinable with --resolve, and a path named by both is a hard error; omitted means the --resolve flags are the whole declaration | ||
--m | -m | list[str] | optional | commit message paragraph, replacing git's own draft; repeating it joins the values with a blank line between them; omitted means git's draft for this operation with its comment block stripped | |
--trailer | list[str] | optional | add a key-value trailer line to the commit message (repeatable) | ||
--discard-unmatched-worktree, --no-discard-unmatched-worktree | bool | optional | destroy working-tree content that matches no side of the conflict. A resolution that writes a stage over the file on disk, or deletes it, is refused when what is there is neither an index stage nor the content git itself wrote -- that is a hand edit, held in no commit, no stage and no stash. Passing this elects the destruction and names each file it takes. Omitted, and with --no-discard-unmatched-worktree, such a path is refused and nothing is committed; resolve it to 'worktree' to commit the edit instead |
#Grants
| Kind | Name | Reason |
|---|---|---|
| proc_mutate | parent-bump | concluding an operation in a submodule moves the parent's gitlink, so safegit commits the parent too when commit.autoBumpParent is on |