LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

dolt-merge

join branch histories and table changes

TLDR

Merge branch into current branch
$ dolt merge [branch_name]
copy
Merge with commit message
$ dolt merge [branch_name] -m "[Merge message]"
copy
Abort in-progress merge
$ dolt merge --abort
copy
Squash merge into the working set, without a merge commit
$ dolt merge --squash [branch_name]
copy
Always create a merge commit, even for a fast-forward
$ dolt merge --no-ff -m "[Merge message]" [branch_name]
copy
Refuse the merge unless it fast-forwards
$ dolt merge --ff-only [branch_name]
copy
Inspect conflicts left behind by a merge
$ dolt sql -q "SELECT * FROM dolt_conflicts"
copy

SYNOPSIS

dolt merge [--squash] branchdolt merge --no-ff [-m message] branchdolt merge --ff-only branchdolt merge --abort

DESCRIPTION

dolt merge joins two histories by incorporating the changes from another branch into the current one. Because Dolt's unit of change is a row rather than a line of text, the merge is a three-way merge over table data and schema: rows touched on only one side are taken directly, and rows changed on both sides are compared cell by cell, so two branches that edit different columns of the same row still merge cleanly.A conflict is raised when both branches change the *same cell* to different values, or when the schemas diverge incompatibly. Unlike Git, Dolt does not write markers into your data. Conflicts are recorded in the `doltconflicts` and `doltconflicts<table>` system tables, which you query and resolve with SQL before committing. Schema and constraint violations land in `doltschemaconflicts` and `doltconstraint_violations`.

PARAMETERS

-m, --message MSG

Use MSG as the commit message for the merge commit.
--squash
Merge the changes into the working set without updating the commit history.
--no-ff
Create a merge commit even when the merge resolves as a fast-forward.
--ff-only
Refuse to merge unless HEAD is already up to date or the merge resolves as a fast-forward.
--commit
Perform the merge and commit the result. This is the default.
--no-commit
Perform the merge but stop just before creating the merge commit.
--no-edit
Use an auto-generated commit message instead of opening an editor.
--author NAME <EMAIL>
Record an explicit author for the merge commit.
--abort
Abort an in-progress merge and return the working set to its pre-merge state.

INSTALL

sudo pacman -S dolt
copy
brew install dolt
copy
nix profile install nixpkgs#dolt
copy

CAVEATS

Conflicts must be resolved through the system tables, not by editing files; a merge cannot be committed while rows remain in `dolt_conflicts`. --squash applies the changes but leaves no link to the merged branch's history, so a later merge of the same branch will reconsider the same commits. The working set must be clean before merging. Merges may also succeed at the row level yet break a foreign key or unique constraint, which surfaces as a constraint violation rather than a conflict.

HISTORY

dolt merge implements git merge semantics for relational data, which is the whole point of the project: making database changes reviewable and mergeable the way code is. Cell-wise three-way merge, schema merge, and the conflict system tables were built out over successive releases as Dolt matured from a data-sharing tool into a MySQL-compatible database.

SEE ALSO

RESOURCES

Copied to clipboard
Kai