A merge brings another branch's commits into the branch you're on. You run it from the branch that receives the work, usually main.
When main has no commits of its own since the feature branched off, there's nothing to combine. Git slides main's label forward to the feature's latest commit. That's a fast-forward: no new commit is made.
text
git log --oneline --graph --all
* d2c2f44 (feature/faq) Add the FAQ
* d5b73e2 (HEAD -> main) Start the shop ← main is behind
git merge feature/faq
Updating d5b73e2..d2c2f44
Fast-forward
faq.html | 1 +
1 file changed, 1 insertion(+)
create mode 100644 faq.html
git log --oneline --graph --all
* d2c2f44 (HEAD -> main, feature/faq) Add the FAQ ← main moved up
* d5b73e2 Start the shopObjectives
- Merge the wishlist into
main. - Check whether the merge made a new commit.
- Delete the merged branch.