开发者

console UI tool for resolving merge conflicts in git... like vimdiff but 'easier'

i'm looking f开发者_JS百科or a console UI tool for resolving merge conflicts in git... like vimdiff but 'easier'


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜