6

我尝试比较整个目录,git-difftool但出现以下错误:

$ git difftool -d
/usr/lib/git-core/git-difftool line 266: File exists

另一种方法是使用该--no-symlinks选项,但这意味着我无法在 diff 工具 (meld) 中编辑文件。

$ git --version
git version 1.9.1

这是导致错误的 perl 脚本的一部分:

256    # Changes in the working tree need special treatment since they are
257    # not part of the index. Remove any trailing slash from $workdir
258    # before starting to avoid double slashes in symlink targets.
259    $workdir =~ s|/$||;
260    for my $file (@working_tree) {
261       my $dir = dirname($file);
262       unless (-d "$rdir/$dir") {
263          mkpath("$rdir/$dir") or
264          exit_cleanup($tmpdir, 1);
265       }
266       if ($symlinks) {
267          symlink("$workdir/$file", "$rdir/$file") or
268          exit_cleanup($tmpdir, 1);
269       } else {
270          copy("$workdir/$file", "$rdir/$file") or
271          exit_cleanup($tmpdir, 1);
272 
273          my $mode = stat("$workdir/$file")->mode;
274          chmod($mode, "$rdir/$file") or
275          exit_cleanup($tmpdir, 1);
276       }
277    }

我打印了这些变量,并注意到它尝试创建符号链接的文件/目录存在。

4

0 回答 0