What is a fast-forward merge in Git?
When the branch you merge already contains all of your branch's commits, git simply moves your branch label forward to its latest commit. No merge commit is needed. That's a fast-forward.
Step by step
Work on a branch:
$ git switch -c dark-modeCommit there, then go back:
$ git switch mainMerge it. If main didn't move meanwhile, it fast-forwards:
$ git merge dark-mode
If both branches have new commits, git can't fast-forward: it creates a merge commit with two parents instead. Force one anyway with git merge --no-ff.