用于解决 git 中合并冲突的控制台 UI 工具...类似于 vimdiff 但“更简单”

发布于 2024-08-13 01:59:57 字数 57 浏览 2 评论 0原文

我正在寻找一个控制台 UI 工具来解决 git 中的合并冲突...就像 vimdiff 但“更简单”

i'm looking for a console UI tool for resolving merge conflicts in git... like vimdiff but 'easier'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

拥抱没勇气 2024-08-20 01:59:57

我仍然使用 vimdiff,但我通常只保留要打开的文件可见(在此窗口上运行 :only),然后禁用差异颜色(大多数情况下)时间伤害了眼睛)与 :diffoff

最后,我有以下映射可以帮助我浏览冲突标记:

nnoremap <space>n /^\(<<<<\\|====\\|>>>>\)<CR>

在正常模式下,按 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:

nnoremap <space>n /^\(<<<<\\|====\\|>>>>\)<CR>

In normal mode, press <space>n and it will search for the markers, then use n to go from marker to marker.

From this point, I then edit my conflicts until I am happy.

悲凉≈ 2024-08-20 01:59:57

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 a git 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.

独留℉清风醉 2024-08-20 01:59:57

这并不完全是您想要的,但是 git stash 对于解决合并非常有帮助。只需这样做:

git stash create
git pull
git stash pop <stashnum>

其中 git stash create 的输出

This isn't exactly what you're looking for, but git stash is very helpful for resolving merges. Just do:

git stash create
git pull
git stash pop <stashnum>

Where <stashnum> is the output from git stash create

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文