Advanced Git
Amanda Crawford-Adamo
Software and Data Engineer
Git Merge Command:
git merge
What is fast forward merge?
$$
When not to use
Git Merge Fast Forward Default
git checkout main
git merge feature_branch
Force Git Merge Fast Forward
git merge <branch> --ff-only
Example
git checkout main
git merge feature_branch --ff-only
What is a recursive merge?
$$
When not to use
Recursive Merge Command:
git merge --no-ff <branch>
Example
$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
$ git merge --no-ff feature_branch
Merge made by the 'recursive' strategy.
...
Fast Forward Merge Commands
git merge <branch_name> # default command
git merge --ff-only <branch_name> # force fast forward merge
Recursive Merge Command
git merge --no-ff <branch_name>
Advanced Git