TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Resolve simple merge conflicts on GitHub

228 pointsby mobyover 8 years ago

6 comments

pkambover 8 years ago
On my team I&#x27;ve found that it&#x27;s incredibly useful to <i>commit</i> the merge conflicts and conflict markers, then immediately resolve the conflicts in the next commit. This gives you one commit that shows exactly how the two branches merged together, followed by a commit that shows exactly how the conflicts were resolved. The resolution commit can then be code reviewed independently for a nice clean view of the conflicts introduced in the merge. It also allows you to easily reset to the merge commit and resolve the conflicts differently.<p>The standard git workflow (and this github feature) seems to promote resolving the conflicts alongside all of the other changes in the merge working copy. This make me nervous, as there&#x27;s no way to differentiate the <i>new</i> lines that were introduced to resolve merge conflicts from the thousands of lines of (previously reviewed) code from the feature branch.<p>If you&#x27;re not careful, completely unrelated working-copy code and behavior can be introduced in a &quot;merge commit&quot; and neither you or any of your reviewers will notice. &quot;Looks good to me.&quot;
评论 #13162458 未加载
评论 #13162547 未加载
评论 #13162437 未加载
评论 #13162498 未加载
评论 #13166520 未加载
评论 #13162447 未加载
评论 #13162428 未加载
messutiedover 8 years ago
So simple, so useful, I wonder if this feature wasn&#x27;t already in Gitlab since it seems to be more full featured
评论 #13162549 未加载
orivejover 8 years ago
diff3 conflict style display would be considerably more useful.
评论 #13162874 未加载
rosstexover 8 years ago
Finally! This is excellent news.
评论 #13162304 未加载
评论 #13162966 未加载
jklein11over 8 years ago
To me this feels like making a commit without unit testing first. When I find a conflict I like to be able to resolve it and then do some unit testing to make sure that my revision didn&#x27;t miss anything.
评论 #13163840 未加载
评论 #13163417 未加载
mojubaover 8 years ago
I didn&#x27;t know I could merge on github.com in the first place... where is their merge function, by the way?
评论 #13162487 未加载