D.Lee
D.Lee

Reputation: 73

Sublime Text 3 - Git Integration

Within ST3, there now is a Git integration but there isn't any documentation on how to get that set up/execute git commands via ST3. Is anyone utilizing this integration now or have experience getting it up and running?

Upvotes: 1

Views: 5636

Answers (1)

OdatNurd
OdatNurd

Reputation: 22791

The documentation for the new Git support in Sublime Text is available on this page of the Official Documentation. Note however that the git integration isn't for taking actions or working with git in general; it only provides visualization of the state of the repository. For working with git explicitly (making commits, checking out code, etc) you still need to use either an external tool such as Sublime Merge or a package in Sublime, such as GitSavvy

In particular, the git integration covers the following (images are taken from the official documentation linked above):

  • Displaying the git status of files in the side bar by applying status badges to them to indicate if that file is untracked, modified, added, etc as well as wether a folder contains modifed files, missing files, etc.

Sidebar Icons

  • Displaying the current branch in the status line, along with status of the number of files that are untracked, modified, staged or unmerged:

Status bar

  • Markers in the gutter of opened files that indicate changes to that file:

Incremental Diff

  • Integration with Sublime Merge in the way of command palette entries and context menus in files and on the sidebar that allow you top take predefined git actions such as opening that repository in Sublime Merge or jumping immediately to things like the file history.

The configuration for this is outlined in the documentation above, but it relates to enabling or disabling the functionality; in particular Sublime Text uses the same Git library for reading the repository that was developed for Sublime Merge and doesn't require any extra setup on your part to work.

Note also that due to address space concerns, Git support is only supported in 64 bit builds of Sublime Text.

Related to this but not strictly covered by the Git status as a whole is that the Sublime theme engine and color schemes have been extended as a result of this to allow for visual styling.

In particular, you can modify your color scheme to adjust the width of the gutter lines used for the inline diff display as well as the colors used for the markers.

You can also modify or extend your theme definition to adjust the colors used for the status badges or to extend the color of the badges to the file entries themselves (the default is to only apply a badge to the file). An example of the built in Adaptive theme being modified to do that is available in this gist.

Upvotes: 4

Related Questions