9

I have the following difftool configuration for KDiff3 in file .gitconfig,

[difftool "kdiff3"]
    external = '"C:/Program Files/KDiff3/kdiff3.exe" "$LOCAL" "$REMOTE" --output "$MERGED"'
    trustExitCode = false
[difftool]
    prompt = false
[diff]

And I am using the following command to see the diff file,

git difftool config/application.config.php -t kdiff3

But when kdiff3 opens, I am unable to edit the file. How can I edit a file in kdiff3 in difftool?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
B Dev
  • 91
  • 1
  • 3

2 Answers2

1

When the KDiff3 window opens up, go to menu MergeMerge Current File.

An output window will be opened where you can resolve the conflicts by selecting, lines from either of your files.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rookie
  • 33
  • 5
-1

If you are in the diff view of KDiff3, right click→Full edit will enable you to edit the file; if you are in the merge view, only the merge result at the bottom can be edited. In the three original file content windows, you can see "Editing disabled" in their status bar.

KDiff3 / Feature Requests / #9 Manual editing

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
K. Symbol
  • 3,330
  • 1
  • 21
  • 22
  • 2
    if I right click nothing happens, what I am doing wrong? I ran it, and cancelled opening files, so I got 2 empty places to paste things from clipboard, after I paste them, I cant edit them! the best comparison app (much better than meld or kompare, as kdiff3 compares by word!) – Aquarius Power Sep 02 '20 at 22:47
  • I think *Aquarius Power* is correct that there isn't any context menu and thus no *"Full edit"* (I tested it on KDiff3 version 1.8.1 on [Ubuntu MATE 20.04](https://en.wikipedia.org/wiki/Ubuntu_MATE#Releases) (Focal Fossa)). Can you [fix](https://stackoverflow.com/posts/54452869/edit) your answer? (But ***without*** "Edit:", "Update:", or similar - the answer should appear as if it was written today.) – Peter Mortensen Sep 13 '21 at 12:48
  • I remember that when I posted the answer, it should be the Windows kdiff3, but now I do not have one PC by hand, could anyone test the Windows version? – K. Symbol Sep 13 '21 at 13:10