6

I want to use meld as my diff tool for git.

If I configure my .gitconfig like this :

[difftool]
    prompt = false
[diff]
    tool = meld

and run command : $ git difftool
then git open a meld window for each file which have changes.

But I want one single window with all my files in the meld list box. I have read a little about -d or --dir-diff option.
When I try : $ git difftool -d
then a single windows is opened with one directory tree in each meld part, but either contain empty directories.
I can not open my files from here.

enter image description here

For infomation :

$ git --version
git version 1.9.1
$ meld --version
meld 1.8.4
$ lsb_release -d
Description:    Ubuntu 14.04.2 LTS

I am using git svn too, but I don't think this is related in my problem; because as far as I understand git-svn, my directory work as a simple git directory.

Related questions :
View differences of branches with meld?

Community
  • 1
  • 1
Benjamin
  • 490
  • 1
  • 5
  • 19

1 Answers1

15

I fixed my problem by removing meld and use a new version (3.12.3) of it:
sudo apt-get remove meld

Now my .gitconfig is like :

[difftool]
    prompt = false

[diff]
    tool = meld
    guitool = meld

[difftool "meld"]
    path = /home/me/App/meld/meld-3.12.3/bin/meld

And the result from the folowing commands are :

  • git diff : terminal diff of each modified files
  • git diff <myfile> : terminal diff of <myfile>
  • git difftool <myfile> : meld diff of <myfile>
  • git difftool : meld diff of each modified files, one bye one
  • git difftool -d : meld diff of each file, into a single window

I have also add this line to my bash_alias but I think it could work without.
alias meld='/home/benjamin/Applications/meld/meld-3.12.3/bin/meld'

Benjamin
  • 490
  • 1
  • 5
  • 19
  • 1
    for this one: [difftool "meld"] path = /home/me/App/meld/meld-3.12.3/bin/meld I tried this in the command to know where is meld installed: whereis meld and it is /usr/bin/meld – Mina Luke Jun 07 '16 at 00:37
  • As this question is always viewed, with Ubuntu LTS 18.04, a simple `sudo apt-get install meld`, `git config --global diff.tool meld` and `git difftool -d` should work. – Benjamin Nov 08 '18 at 11:02
  • This is perfect. It works as expected. Thanks!!. do you use meld for merging, rebase and conflict resolution? – ininprsr Dec 07 '18 at 07:30
  • 1
    @ininprsr Yes. `git difftool -d` for a diff. `git mergtool` to resolve a conflict. – Benjamin Dec 07 '18 at 11:01