A proper merge tool<\/a> will help you better understand a conflict scenario and make the right decision.<\/p>\nHave Confidence<\/h3>\n With all the safety nets in place that Git provides, there’s really no need to be afraid of merge conflicts in any way. Once understood how they work and what your options are, you should be ready to merge like there’s no tomorrow. Always keep in mind: you can’t break anything!<\/p>\n
Note from the Editor<\/h3>\n Tobias modestly left out Tower as an excellent tool to help with merge conflicts. In fact one of the reasons I personally use Tower is because I like how it helps with merge conflicts. <\/p>\n
It’s very clear when you have a conflict:<\/p>\n \n<\/figure>\nAnd right-clicking on the conflicted file gives you some nice options:<\/p>\n <\/figure>\nSo my process is usually:<\/p>\n
\nIs it very obvious to me whether my changes to this file or the other branches changes to this file should “win”? If so, select the relevant “Resolve <file> Using Mine” or “Resolve <file> Using Theirs”<\/li>\n If I need a closer look, pop it open in a code editor and check it out. Then maybe still I can use one of those options.<\/li>\n If it’s more complicated, manually fix it up and then choose “Mark <file> as Manually Resolved” from Tower.<\/li>\n Sometimes use a Merge Tool if there is a lot of complex fixes, which Tower also supports opening conflicts in via the “Open <file> in Merge Tool” option.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"Everybody has a list of things they don’t like: an appointment at the dentist, a traffic jam, or a canceled flight. When I was preparing my book, I wasn’t surprised that a lot of designers and developers would add merge conflicts to this list without hesitation. When using Git for version control, there is nothing […]<\/p>\n","protected":false},"author":247217,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[4],"tags":[766,1038,1045],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":354389,"url":"https:\/\/css-tricks.com\/merge-conflicts-what-they-are-and-how-to-deal-with-them\/","url_meta":{"origin":168055,"position":0},"title":"Merge Conflicts: What They Are and How to Deal with Them\u200b","date":"October 28, 2021","format":false,"excerpt":"Merge conflicts... Nobody likes them. Some of us even fear them. But they are a fact of life when you're working with Git, especially when you're teaming up with other developers. In most cases, merge conflicts aren't as scary as you might think. In this fourth part of our \u201cAdvanced\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/10\/conflict-in-textfile@2x.png?fit=1130%2C622&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":316153,"url":"https:\/\/css-tricks.com\/cmdz-for-git-is-here\/","url_meta":{"origin":168055,"position":1},"title":"CMD+Z for Git is Here","date":"July 23, 2020","format":false,"excerpt":"Version control with Git has become a \"commodity\" by now: virtually every software project today uses Git, and virtually every developer knows Git to some extent. This explains why I sometimes hear the following question when I talk about what I do for a living: \"A desktop client for Git?\u2026","rel":"","context":"In "Sponsored"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2020\/07\/tower_testimonials@2x.png?fit=1200%2C550&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":356700,"url":"https:\/\/css-tricks.com\/cherry-picking-commits-in-git\/","url_meta":{"origin":168055,"position":2},"title":"Cherry-Picking Commits in Git","date":"November 17, 2021","format":false,"excerpt":"In part 5 of this series, we looked at rebasing and merging. Although there are a couple of differences between git merge and git rebase, both commands have the same goal: they integrate changes from one branch into another.","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/11\/git-cherry-picking.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":354734,"url":"https:\/\/css-tricks.com\/rebase-vs-merge-integrating-changes-in-git\/","url_meta":{"origin":168055,"position":3},"title":"Rebase vs. Merge: Integrating Changes in Git","date":"November 2, 2021","format":false,"excerpt":"This article is part of our \u201cAdvanced Git\u201d series. Be sure to follow us on Twitter or sign up for our newsletter to hear about the next articles! Most developers understand that it's important to use branches in Git. In fact, I've written an entire article on branching strategies in\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/10\/rebase-git.jpg?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":175076,"url":"https:\/\/css-tricks.com\/sponsored-tower-2-0-make-git-easy\/","url_meta":{"origin":168055,"position":4},"title":"Tower 2.0 is Here – To Make Git Easy!","date":"July 24, 2014","format":false,"excerpt":"Most people wouldn't call version control their hobby. But in the last few years, people have also become aware of how valuable it is. Nowadays, you won't find a top programmer, web developer, or web designer who doesn't use version control. In part because it helps you produce better results\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":352569,"url":"https:\/\/css-tricks.com\/better-collaboration-with-pull-requests\/","url_meta":{"origin":168055,"position":5},"title":"Better Collaboration With Pull Requests","date":"October 11, 2021","format":false,"excerpt":"This article is part of our \u201cAdvanced Git\u201d series. Be sure to follow us on Twitter or sign up for our newsletter to hear about the next articles! In this third installment of our \u201cAdvanced Git\u201d series, we\u2019ll look at pull requests \u2014 a great feature which helps both small\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2021\/09\/Untitled-3-2.png?fit=1200%2C375&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/168055"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/247217"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=168055"}],"version-history":[{"count":5,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/168055\/revisions"}],"predecessor-version":[{"id":250052,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/168055\/revisions\/250052"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=168055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=168055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=168055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}