Sublime Forum

Use sublime for a more specific diff view?

#1

Is it possible to set sublime up to review a diff against a commit well in the past? Either with the little marker colours in the gutter or with sublime-merge to show the differences of many commits at once?

0 Likes

#2

You can accomplish this in Sublime Merge by selecting any two commits to diff between them.

0 Likes

#3

For Sublime Text specifically, git tracked files will only track either the HEAD or the index as the base file, depending on the value of the git_diff_target setting.

That said, it’s possible for a plugin to use the API to change the text that is diffed against the current buffer (known as the reference document) to whatever it wants. So, a plugin would be able to get the content of a file as of a particular commit (say by executing an appropriate git command in the background) and use that to set the reference document.

I’m not aware of any that have been written to do that, though.

1 Like

#4

How does one go about that?

0 Likes

#5

Click on the first commit, then Ctrl+Click the second commit; the diff on the right will change to show you what’s different between the two commits. The header shows you what commit you’re diffing from:

2 Likes