From the course: Complete Guide to Git

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Merge conflicts

Merge conflicts

- [Instructor] We learned how to merge one branch into another. The process was simple and went smoothly. Unfortunately, it's not always that easy. In this movie, we will learn about merge conflicts. A conflict occurs when there are two changes to the same line or set of lines in two different commits that are being merged together. Let me give you a simple example. Let's imagine that somewhere in a file in the main branch is the text Git is great, and I start out a project to make text edits, and so I make a feature or topic branch called text_edits and I start making changes, and one of the edits that I make is an edit to this line, and I change it from Git is great to Git is useful, and I make that as a commit in the text edits branch. Soon after, as I'm continuing to work on the main branch, I also decide to make an edit to this line, but I change it to Git is powerful, and I commit that. Now there's two change sets in the repository, one in the main branch and one in the text…

Contents