--- source_keys: - context7-git-htmldocs - atlassian-gitflow-tutorial --- # Merging one branch into another Scope is fast-forward and merge-commit mechanics plus conflict resolution. Rebase and cherry-pick belong to `git-commits`; revert to `git-history`. - **Fast-forward** — `rtk git merge ` advances the pointer with no merge commit when the target has not diverged. - **True merge** — `rtk git merge --no-ff ` forces a merge commit even when a fast-forward is possible. Gitflow requires it on every supporting-branch merge. - **Squash merge** — `rtk git merge --squash ` stages the combined diff without committing. Follow it with a `rtk git commit`. - **Octopus merge** — `rtk git merge branch-a branch-b branch-c` merges more than two branches at once, but fails outright on any conflict. Use sequential two-way merges when conflicts are likely. ## Conflict resolution When Git cannot auto-merge it writes conflict markers and stops mid-merge. Run `rtk git status` to list the conflicted files, edit each to resolve its markers, then `rtk git add ` and `rtk git merge --continue`. - `rtk git merge --abort` restores the pre-merge state. - `git mergetool` opens the configured merge tool — bare, not `rtk`: it hands control to an interactive child process, and a token filter has nothing to offer there (ADR-0023). - `rtk git diff --diff-filter=U` shows only the still-conflicted files.