How To Merge Git Branches

One of the most powerful things about Git is that you’re able to collaborate with other people on the same code base. However, there are instances where my teammates are doing some great development, and my supervisor asks me to bring their changes into my branch. This gets complicated because my branch was based off of the main branch, which doesn’t have their changes. So, I have to merge their branch into my branch.

In this video, I’ll be discussing two main ways to do this: using git merge or git rebase. These are the two methods I’ve used in my companies, and I’ll share which one I prefer. I’ll also go through an example of how to perform these kinds of merges.

Additionally, I’ll talk about merge conflicts, which you’ll inevitably encounter when merging different branches together. This happens when changes touch the same lines of code, and Git doesn’t know how to resolve it, so you have to do it manually.

In this video, you’ll learn:
✅ Git merge
✅ Git rebase
✅ Merge conflicts

Thank you for watching, and happy coding! 💻🧡
-Henrik