Skip to content
David Lynch edited this page Sep 28, 2011 · 31 revisions

Sublime Text 2: git plugin

I like being able to quickly ask my editor "what's the history of this file?", without having to jump to another window. This plugin implements just enough git commands to be useful to me at the moment.

I may add more, I may not. If you submit a pull request implementing something I missed, I'll almost certainly accept it.

Installation

First, you need to have git installed and in your $PATH.

Do this on OSX:

$ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
$ git clone git://github.com/kemayo/sublime-text-2-git.git Git

...and it should work.

In Linux (Ubuntu like distros), do this:

$ cd .config/sublime-text-2/Packages/
$ git clone git://github.com/kemayo/sublime-text-2-git.git Git

If you're on Windows 7:

Copy the directory to: "C:\Users\<username>\AppData\Roaming\Sublime Text\Packages"

If you're on Windows XP:

Copy the directory to: "C:\Documents and Settings\<username>\Application Data\Sublime Text 2\Packages"

What's supported?

Command Palette

Log viewing

Log view

You can view the log, for the current file or for the whole repo.

Filtered log view

You can use fuzzy matching on the log details while viewing the log to find interesting commits.

Commit details

You can see more details about the given commit. This is either restricted to just your current file, or for all files in the repo, depending on how you got to it.

Diff viewing

Diff view

Show uncommitted changes in the current file or the whole repo. Displays with appropriate syntax highlighting.

Blame

Get an annotated version of the entire current file, or just the selected lines. (It's ugly now. I might fix it.)

Clone this wiki locally