用于解决 git 中合并冲突的控制台 UI 工具...类似于 vimdiff 但“更简单”
我正在寻找一个控制台 UI 工具来解决 git 中的合并冲突...就像 vimdiff 但“更简单”
i'm looking for a console UI tool for resolving merge conflicts in git... like vimdiff but 'easier'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我仍然使用
vimdiff
,但我通常只保留要打开的文件可见(在此窗口上运行:only
),然后禁用差异颜色(大多数情况下)时间伤害了眼睛)与:diffoff
。最后,我有以下映射可以帮助我浏览冲突标记:
在正常模式下,按
n
,它将搜索标记,然后使用n 从一个标记转到另一个标记。
从这一点开始,我就会编辑我的冲突,直到我满意为止。
I stayed with
vimdiff
, but I usually keep only the file to open visible (run:only
when on this window), and then I disable the diff colors (which most of the time hurt the eyes) with:diffoff
.Finally, I have the following mapping which helps me to browse through the conflict markers:
In normal mode, press
<space>n
and it will search for the markers, then usen
to go from marker to marker.From this point, I then edit my conflicts until I am happy.
thirdsome.vim
vim 插件提供了比普通 vimdiff 更友好的合并工具。关于当您 git pull 时查看哪些文件将发生更改的评论: git diff --stat HEAD..origin/$(git rev-parse --abbrev-ref HEAD)< /code> 在
git fetch
之后会告诉你这一点。 (如果您确实只想要名称而不需要其他内容,请将--name-only
替换为--stat
。或者完全省略--stat
查看实际传入的差异)您可能需要在全局配置文件中为此添加一个别名。The
threesome.vim
vim plugin provides a friendlier merge tool than vanilla vimdiff.Regarding the comment about seeing which files are going to change when you
git pull
:git diff --stat HEAD..origin/$(git rev-parse --abbrev-ref HEAD)
after agit fetch
will tell you that. (Substitute--name-only
for--stat
if you really just want the names and nothing else. Or omit--stat
altogether to see the actual incoming diffs) You'll likely want to add an alias for this in your global configuration file.这并不完全是您想要的,但是 git stash 对于解决合并非常有帮助。只需这样做:
其中
是git stash create
的输出This isn't exactly what you're looking for, but
git stash
is very helpful for resolving merges. Just do:Where
<stashnum>
is the output fromgit stash create