From the course: Git: Branches, Merges, and Remotes
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Strategies to reduce conflicts
From the course: Git: Branches, Merges, and Remotes
Strategies to reduce conflicts
- [Instructor] In this movie, I want to talk about a couple strategies that you can use to reduce merge conflicts. Merge conflicts aren't pleasant to have to solve so if we can use some strategies to reduce them it's going to pay big benefits. The first and simplest is just to keep your lines short. If lines are short there's less characters in them, it's less likely that something's going to conflict, and it's easier to identify and fix conflicts when they arise. We saw this in the last movie when we had this long block of text. It was difficult to find what had changed in it. But if the lines had been very short, as they often are in code, it would've been easier. You also want to keep your commits small and focused. Don't make commits that are enormous in scope, that touch on 50 or 60 different files, especially if those are not related changes. Instead, make a commit that does one single thing. It makes it easier forget to merge that commit with other commits and it's easier for…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.