Merge
Merge allows you to combine the independent branch developments into a single branch. Git will also try and merge the different branch commit histories together for you.
Let’s now view our Main branch on Gitlab, notice our new file README.md is not there
Fig 3
We can validate what branch we are on, you should see the asterisk on the dev branch
git branch
* dev
main
Now using the checkout command, switch back to the main branch
git checkout main
Fig 4
Now we call the branch we want to merge into our current working branch. We will merge dev into main.
git merge dev
Fig 5
Remember, this is only a merge locally, you must still push these changes to the remote repository at Gitlab
git push
Fig 6
Flipping back over to our Gitlab site
Fig 7
From here we can click on History to view commits that have been made
Fig 8