git difftool to give directory compare? [duplicate]

拈花ヽ惹草 提交于 2019-11-27 07:58:29
VonC

Update June 2012 (2 and an half years later):

This (comparing directories instead of file-by-file) seems to be soon available:
See [ANNOUNCE] Git 1.7.11.rc1:

"git difftool" learned the "--dir-diff" option to spawn external diff tools that can compare two directory hierarchies at a time after populating two temporary directories, instead of running an instance of the external tool once per a file pair.

See "Patch difftool: teach difftool to handle directory diffs"


Original answer (January 2010)

One could pull a copy of the changed files from staging/checked in files into a temp folder, and then open that up. Is that the only option?

Basically yes:

You difftool script would:

  • create 2 temp directories
  • defines itself as a diff tool
  • call git diff
    • which then call itself for file to diff
    • in that mode, the same script, for each files, only copy the two version to diff in the two temp directories
  • then go on and call diff tools (like beyondCompare or WinMerge) on the two temp directories

You have one first example in this question.

I always use --dirstat=files:

rudie@devver:virenze$ git diff --dirstat=files
   4.1% modules/custom/virenze_conversations/
   7.0% modules/custom/virenze_crs/
   8.3% modules/custom/

which means I've removed dirs virenze_conversations and virenze_crs in custom. (I don't know what the percentages mean...)

You can probably use all the normal diff options: --cached, branch name etc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!