Although I have been straying more and more into the commandline realm the past two years " vim, cscope etc, etc, I was staying away from command line diffing tools until recently. I had been satisfied with melddiff viewer for Ubuntu. However, working on a remote putty does not make your life a hell of a lot easier. So, I discovered vimdiff, which once you get the hang of it is a simple but powerful tool and it also comes bundled with vim. So, the following are some of the commands that I found of paramount importance (ofcourse knowing vim is a pre-requisite) :

[c - move to the change above you
]c - move to the change below you

Move your cursor to a change and
do - will get the changes from the other window to the current window
dp - will put the changes in the current window to the other window

Both are helpful and useful as you might have to merge a change where one window has extra lines.

:diffu - which will recaculate diff and highlight the changes again. This is useful once you have already merged and undid your changes and the diffs are not highlighted anymore.

No comments:

Post a Comment