git 中的 vimdiff 和 vimdiff2 有什么区别?
What's the difference between vimdiff and vimdiff2 in git?
它们有什么区别?我的搜索引擎结果只谈论 vimdiff,但命令
git mergetool
两者都给我。
vimdiff2
在 commit 0008669 中引入(2010 年 9 月,针对 git 1.7.4)
是like vimdiff, but with different merge options (as commented in commit b2a6b71,git1.8.2:"vimdiff and vimdiff2 differ only by their merge command")。
它 (vimdiff2
) 强制进行双向合并,而 vimdiff
将使用 3-way merge 如果基础(常见检测到祖先):
gvimdiff|vimdiff)
if $base_present
then
"$merge_tool_path" -f -d -c 'wincmd J' \
"$MERGED" "$LOCAL" "$BASE" "$REMOTE"
else
"$merge_tool_path" -f -d -c 'wincmd l' \
"$LOCAL" "$MERGED" "$REMOTE"
fi
;;
gvimdiff2|vimdiff2)
"$merge_tool_path" -f -d -c 'wincmd l' \
"$LOCAL" "$MERGED" "$REMOTE"
;;
请注意 commit 7c147b7(2014 年 4 月,对于 Git 2.1.0 2014 年 8 月)实际上也引入了 vimdiff3
:
It's similar to the default, except that the other windows are hidden.
This ensures that removed/added colors are still visible on the main merge window, but the other windows not visible.
Specially useful with merge.conflictstyle=diff3
.
它们有什么区别?我的搜索引擎结果只谈论 vimdiff,但命令
git mergetool
两者都给我。
vimdiff2
在 commit 0008669 中引入(2010 年 9 月,针对 git 1.7.4)
是like vimdiff, but with different merge options (as commented in commit b2a6b71,git1.8.2:"vimdiff and vimdiff2 differ only by their merge command")。
它 (vimdiff2
) 强制进行双向合并,而 vimdiff
将使用 3-way merge 如果基础(常见检测到祖先):
gvimdiff|vimdiff)
if $base_present
then
"$merge_tool_path" -f -d -c 'wincmd J' \
"$MERGED" "$LOCAL" "$BASE" "$REMOTE"
else
"$merge_tool_path" -f -d -c 'wincmd l' \
"$LOCAL" "$MERGED" "$REMOTE"
fi
;;
gvimdiff2|vimdiff2)
"$merge_tool_path" -f -d -c 'wincmd l' \
"$LOCAL" "$MERGED" "$REMOTE"
;;
请注意 commit 7c147b7(2014 年 4 月,对于 Git 2.1.0 2014 年 8 月)实际上也引入了 vimdiff3
:
It's similar to the default, except that the other windows are hidden.
This ensures that removed/added colors are still visible on the main merge window, but the other windows not visible.Specially useful with
merge.conflictstyle=diff3
.