Skip to content

Git

Merge Preferences

What each method does:

Method What it does Example
Merge commit Ties both branches together with a new commit. git merge --no-ff feature
Squash Collapses all commits into one, then merges. git merge --squash feature
Rebase Replays your commits onto the target tip, no merge commit. git rebase main
Fast-forward Slides the branch pointer forward, no new commit. git merge --ff-only feature
Cherry-pick Copies specific commits onto another branch. git cherry-pick <commit>

Merge commit

gitGraph
   commit id: "A"
   branch feature
   commit id: "B"
   commit id: "C"
   checkout main
   merge feature

Squash

gitGraph
   commit id: "A"
   branch feature
   commit id: "B"
   commit id: "C"
   checkout main
   commit id: "B+C"

Rebase

gitGraph
   commit id: "A"
   commit id: "B'"
   commit id: "C'"

Fast-forward

gitGraph
   commit id: "A"
   commit id: "B"
   commit id: "C"

Cherry-pick

gitGraph
   commit id: "A"
   branch feature
   commit id: "B"
   commit id: "C"
   checkout main
   cherry-pick id: "C"

Merge Methods & Commit Signatures

Each merge method treats the branch's commit signatures differently. Pick your method with this in mind when signatures matter (bot commits are SSH-signed and show a signature badge).

Method What happens to the branch commits' signatures
Fast-forward Preserved: the original signed commits land on the target untouched.
Merge commit Preserved in history. The merge commit itself is a new commit, signed by whoever creates it.
Squash Discarded: the branch commits are replaced by one new commit with a new signature (or none).
Rebase Discarded: replayed commits are new objects. Your local git re-signs only if configured.

When you merge through forgejo, the server creates the merge/squash commit and signs it as the system service account with the instance key, so web merges show a signature, but it is the instance's signature, not the PR author's. Only a fast-forward merge lands the author's own signed commits on the target branch unchanged.

Older merge commits

Instance signing was enabled in July 2026. Web merges made before then are unsigned and cannot be re-signed.