I am hoping I have a simple question for you, but I can't find an answer anywhere (I have been searching for 2 days, maybe I am dumb?). I am trying to develop a git workflow to collaboratively edit LaTeX files with my PhD adviser. The problem we face is due to the behavior of git merge (because it merges automagically). I want git to conflict anytime it sees a file change, even if it is an addition, subtraction, or minuscule change, is this possible? This way we can both pick and choose changes and continually push to master.
I am not opposed to using another tool, but I would prefer not to create a complicated branching system. I assume branching is unnecessary when 2-3 people are working on the same file. Thank you so much for your help!
Stop the merge from completing with --no-commit
Get a list of files that were changed on both sides by performing git diff --name-only HEAD...MERGE_HEAD and git diff --name-only MERGE_HEAD...HEAD
Redirect the two lists of files to comm -12 to get just files that were modified by both branches.
Note the following
::, e.g. :0:README, :README A colon, optionally followed by a stage number (0 to 3) and a colon, followed by a path, names a blob object in the index at the given path. A missing stage number (and the colon that follows it) names a stage 0 entry. During a merge, stage 1 is the common ancestor, stage 2 is the target branch’s version (typically the current branch), and stage 3 is the version from the branch which is being merged.
For each file listed in the comm output you can then call git difftool (presuming that will invoke vimdiff for you) and specify any combination of :0:, :1:, :2:, :3: that you want to see various diffs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With