Is there a command-line equivalent to kdiff3 that allows selective merging? [closed]
Asked Answered
S

2

6

kdiff3 is a GUI diff tool that allows you to create a diff of two/three files and selectively choose which lines make up the merged file. Is there a command-line equivalent?

Sixgun answered 6/5, 2013 at 22:38 Comment(0)
D
6

You should try

vimdiff file1 file2

Ex :

enter image description here

You can select lines (from command mode to visual mode) with shift+v, copy with yy, paste with p and switch into files with ctrl+ww

See http://vimdoc.sourceforge.net/htmldoc/diff.html

Daynadays answered 6/5, 2013 at 22:40 Comment(1)
To navigate: ]c next change, [c previous change, dp 'diff put' to other buffer, do 'diff obtain' from other bufferZulazulch
C
2

Yes, vimdiff (quick tutorial linked) is quite good at it. Being part of VIM, you will have to learn the key strokes you need to accept or refuse changes.

Closefisted answered 6/5, 2013 at 22:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.