Skip to content

zdiff3

Just use diff3. Really, right now go to your terminal and type git config --global merge.conflictStyle zdiff3

what is it

Its a conflict resoultion style, it shows you the commo.. ok just look here:

If you don’t konw what your looking at, go read another post.

<<<<<<< HEAD
const title = "hi"
=======
const title = "hello world"
>>>>>>> theirs

zdiff3 adds a new line, feel the difference yet?

<<<<<<< HEAD
const title = "hi"
||||||| 3960d3d
const title = "old title"
=======
const title = "hello world"
>>>>>>> theirs

whats great about zdiff3 and why i cant understand why its not the default setting, is that it allows you to clearly see the intent behind the other party’s change. in case of a title you might not give a shit, but consolidating a type, updating contract, or adding feature.

concept

diff command gives you a collection of changes called hunks.

Comparing two identical files yields one sequence of common lines and no hunks, because no lines differ. Comparing two entirely different files yields no common lines and one large hunk that contains all lines of both files gnu

git is sequential, tree like, but conflicts may still occure. For example, you pull changes on edited branch.

why its importan

I’ll chirp when there’s a new post

One email per new post, usually on a Friday. Nothing else, and you can unsubscribe anytime.

Prefer a feed reader? There’s an RSS feed.

© Alex Kovalev. All rights reserved. · Privacy Policy