git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-difftool

From
David Aguilar <davvid@gmail.com>
Date
Dec 26, 2008, 01:30 UTC
Message-ID
<20081226013021.GA15414@gmail.com>

Several co-workers have found this script useful. It's basically git-mergetool modified to operate on the git index/worktree. There's some things about the script that aren't very gitish (for example, the way revargs are processed) but it's useful nonetheless.

The usual use case for this script is when you have either staged or unstaged changes and you'd like to see the changes in a side-by-side diff viewer (e.g. xxdiff, tkdiff, etc).

	git difftool [<filename>*]

Another use case is when you'd like to see the same information but are comparing arbitrary commits (this is the part where the revarg parsing could be better)

	git difftool --start=HEAD^ --end=HEAD [-- <filename>*]

The last use case is when you'd like to compare your current worktree to something other than HEAD (e.g. a tag)

	git difftool --commit=v1.0.0 [-- <filename>*]

It's a generally useful script so I thought I'd share it here. If others find it useful then maybe we can fix it up and ship it along with the other useful goodies in contrib/.

enjoy,
-- 
	David
Next: Matthieu Moy
Message 1 of 16 in “git-difftool”
  1. David AguilarDec 26, 2008
  2. Matthieu MoyDec 31, 2008
  3. David AguilarDec 31, 2008
  4. Boyd Stephen Smith Jr.Dec 31, 2008
  5. Matthieu MoyJan 1, 2009
  6. Markus HeidelbergJan 2, 2009
  7. Matthieu MoyJan 2, 2009
  8. David AguilarJan 2, 2009
  9. Markus HeidelbergJan 15, 2009
  10. David AguilarJan 16, 2009
  11. Ping YinJan 1, 2009
  12. Markus HeidelbergJan 2, 2009
  13. Ping YinJan 2, 2009
  14. ensoJan 17, 2009
  15. David AguilarJan 17, 2009
  16. Ping YinJan 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.