Following the documentation, I made a simple menu located in the …button to the right of Search in the toolbar to use external diff viewers to compare the selected commit with current state, HEAD or previous commit, also offering to compare the uncommitted current state with HEAD. To use this, put the following in a new file Action.sublime-menu
, in the User loose packages/User
directory (e.g. for mac, it’s ~/Library/Application Support/Sublime Merge/Packages/User
) (for other platforms, refer to the location listed here). To see how to set up git difftool
, see this.
File Action.sublime-menu
:
[
{
"caption":"External diff...",
"children":
[
{
"caption": "with current state",
"command": "git",
"args": {"argv": ["difftool","$short_commit"]}
},
{
"caption": "with previous",
"command": "git",
"args": {"argv": ["difftool","$short_commit^!"]}
},
{
"caption": "with HEAD",
"command": "git",
"args": {"argv": ["difftool","$short_commit","HEAD"]}
},
{
"caption": "current vs. HEAD",
"command": "git",
"args": {"argv": ["difftool"]}
}
]
}
]