Git merge
git merge takes the commits from another branch and joins them into the branch you are on.
If your branch has no new commits of its own, Git just moves it forward (a fast-forward). If both branches have new commits, Git makes a merge commit that joins them.
Merge a fix into main
git switch main
Switched to branch 'main'
git merge emergency-fix
Updating 90fe82c..b4d3923
Fast-forward
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
A merge that makes a merge commit
Both branches have new commits, so Git joins them with a new commit:
git merge hello-world-images -m "Merge branch 'hello-world-images'"
Auto-merging index.html
Merge made by the 'ort' strategy.
index.html | 1 +
1 file changed, 1 insertion(+)