From the course: Complete Guide to Git
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Strategies to reduce conflicts - Git Tutorial
From the course: Complete Guide to Git
Strategies to reduce conflicts
- [Instructor] Resolving merge conflicts can be a chore. In this movie, let's discuss some strategies that can reduce the number of merge conflicts. The first thing you can do is try to keep the lengths of lines short. In code, these are often going to be short lines anyway, but if we're writing text, it might be paragraphs of text. The longer a line is, the more susceptible it is to having a merge conflict because Git applies these change sets on a line by line basis. It's also a best practice to make atomic commits that are small and focused on the task at hand. Having small sets of changes allows Git to process each one easier and to not run into conflicts. As we saw in the last movie, you need to beware of edits to white space characters, like spaces, tabs, and line returns. These may seem insignificant and inconsequential to you as you're working with your files, but to Git, they represent changes that need to be resolved. That doesn't mean you can't make changes to whitespace…
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.