After finishing work on a branch, you merge it back into main:
git switch main # go back to main
git merge feature # bring feature's commits into main
When main hasn't changed since branching, Git simply moves the main pointer forward — no merge commit needed:
Before: main → A
feature → A → B → C
After: main → A → B → C
feature → A → B → C
When both branches have diverged, Git creates a new merge commit that combines both histories:
Before: main → A → B
feature → A → C
After: main → A → B → M (merge commit, M has two parents: B and C)
feature → A → C
The feature branch already has a commit. Switch to main and merge feature into it.
Click "Run" to execute your code.