diff --git a/020_git-mergetool.sh b/020_git-mergetool.sh index 0a40699..50cf97d 100755 --- a/020_git-mergetool.sh +++ b/020_git-mergetool.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash + +# Concepts for resolving Git conflicts +# https://gist.github.com/karenyyng/f19ff75c60f18b4b8149 + BIN_DIR=/usr/local/bin #BIN_DIR=~/bin @@ -15,9 +19,11 @@ git difftool --tool-help TOOL_PATH=nvim DIFF_TOOL=nvimdiff # terminal diff/merge tool MERGE_TOOL=nvimdiff -DIFF_STYLE="LOCAL,MERGED,REMOTE" +# DIFF_STYLE="LOCAL,MERGED,REMOTE" +DIFF_STYLE="LOCAL,BASE,REMOTE / MERGED" -mergetool.nvimdiff.layout 2 +git config --global merge.tool ${DIFF_TOOL} +git config --global mergetool.${DIFF_TOOL}.layout "${DIFF_STYLE}" # $LOCAL is the file in the current branch (e.g. master). # $REMOTE is the file in the branch being merged (e.g. branch_name). @@ -41,7 +47,7 @@ git config --global difftool.${DIFF_TOOL}.path "${TOOL_PATH}" git config merge.tool ${MERGE_TOOL} git config --global merge.tool ${MERGE_TOOL} -git config merge.layout ${DIFF_STYLE} +git config merge.layout "${DIFF_STYLE}" git config --global mergetool.${MERGE_TOOL}.layout "${DIFF_STYLE}" git config --global mergetool.${MERGE_TOOL}.path ${TOOL_PATH}