Hacker News new | past | comments | ask | show | jobs | submit login
SublimeGit: Full-featured Git integration for Sublime Text (sublimegit.net)
163 points by nreece on Oct 9, 2013 | hide | past | favorite | 86 comments



Wow... So yeah, I made this. Woke up this morning to a slew of twitter mentions and quite a few orders. Thank you so much for the support!

I'm about to get on a 14 hour international flight in a couple of hours, but i'll be happy to answer any questions. Also, i'm tweeting from @SublimeGit every once in a while.


I just downloaded this and it's everything I ever dreamed it could be. Thank you.


It is great, however when doing a Git Status, the shortcuts are not compatible with VI-input mode since they are vi-commands (i,C etc), could you make it possible to use cmd+shortcut?


I've got an outstanding issue on that. Will probably be fixed within a couple of weeks. I'm hoping to do it in a somewhat backwards compatible way, which makes it a little difficult.


One thing I think should be flipped to 'off' by default is the long-form commit descriptions --with largish source files there is significant slow-down, and sometimes ST crashes.


Looks good, I'll give it a try, but I have to mention this plugin as it deserves all the praise it can get!:

https://github.com/jisaacks/GitGutter http://www.jisaacks.com/gitgutter


I've always found this plugin slow which is a shame. It's nice to visually see the changes made to a file.


If you are using ST3 you can use non blocking mode and GitGutter will run in a seperate thread.

EDIT: Here is the section on the read me about it: https://github.com/jisaacks/GitGutter#non-blocking-mode


It still ran slowly on my machine. Typed characters were noticeable more sluggish to appear on screen. Just a bit, but noticeable and it was too much. Maybe it didn't work for some reason.


Aha! I didn't know about this. You're awesome!


Really?

I've done this with "big" files, as well as large folders and it works perfectly both locally and over a NFS share.

How many LoC are the files you editing?


I used that for quite a while before I discovered Modific (https://github.com/gornostal/Modific). Similar functionality, except you can hit a shortcut and see what was on that line before the change - pretty useful stuff!


hmm, i think i'll try a vim-gitgutter


I suggest this one: https://github.com/airblade/vim-gitgutter

It's quite nice, but I would turn off live updating, as that slowed things down a bit for me. Updating on save works perfectly fine.


What are the advantages of using this plugin over using git in the terminal directly? The time to switch windows is always pretty marginal with Cmd-Tab, so that doesn't seem like a big enough win to me. (I'm honestly curious, I can't think of the big ones, but if I could I might switch.)

I could imagine diffing being a way better experience straight from the file you want to diff, and with code highlighting. That definitely sucks from the command line, but it's also pretty rarely needed.

Anything else?

The big disadvantage I see is that this is not going to be on anyone else's computer when I'm pairing or just messing around with them, so if I get accustomed to not using command-line interface then I get screwed when I'm not on my own computer...

Edit: the quick-commit feature looks pretty cool as a way to encourage making smaller commits, since I always forget to commit in smaller pieces.


Well I am a heavy magit user.

There are numerous advantages one of being that magit uses multiple buffers to show contextual information. For example I can get a nice ASCII view of the commit log in one buffer (in all the available formats) and see the diffs for each commit with glorious colour-highlighting in the other, side-by-side. The diff buffer updates as I scroll through the history.

Easier to remember mnemonics for common tasks.

I can use magit-blame-mode to see the blame information inline with the file as I edit it.

Diffs are super-easy and I can jump right to any file to fix things as I come across them from the logs or the status view.

Plus emacs... so I get hooks into magit that I can use from other packages like org-mode, etc.

I find the command-line to be tedious and slow now. I'd rather use a smart front-end with sane defaults and a nice interface.


> What are the advantages of using this plugin over using git in the terminal directly?

Speaking generally to editor integrations and VCS GUI tools, the prime advantages vs. the CLI tools are:

1) Uninterrupted workflow for common tasks. Select files for commit, review the diffs, then commit all without leaving the editor.

2) Better visualization and interactive workflow. Examples include, good intra-line, side-by-side diff. Being able to `git blame` then trivially explore the associated commits and surrounding history for those commits. Yes, it's possible to do all of this from the command line, but it's often clunky compared to well-thought out tooling. With some VCS systems and projects, graphical display and navigation of history is helpful for understanding the relative state of branches, tracking down obscure bugs, etc.

That said, I'm not a fan of glossy GUI tools that hide the working model of the underlying VCS. For the most part, not using the CLI is a great way to never really "get" version control as a powerful workflow tool. Perforce's P4V GUI tool gets credit on this point. The last time I used it, there was a console that showed the command line run and results for every GUI action. This happened to be a nice learning tool, providing relevant, live examples of basic and advanced usage.


Lots of people prefer to interact with their VCS tools via a GUI, and a reasonably large subset of those people prefer for the integration to be built in to their IDE/editor.

Probably 60% of the people at the company I work at don't even know how to use Git or SVN from the command line.

This seems like a decent enough bridge between those two worlds.


I am bit bummed that you have to pay for Git interface. Yeah, it is just 10€ / user, but still. You even get full games for 99 cents these days. And shouldn't this be a default feature in the first place.

Anyway, no-one is forcing anyone to buy it, so all good.


I hope that for 10€ most people will find it worth it. If you've already spent 60$ or more on Sublime Text and upgrades, I can see why this might seem weird. However, as the homepage says you can basically install it and use it for free as long as you like. You'll get a popup occasionally (if you do use it), but that's the only "restriction".

Also, for a free alternative, I have to mention https://github.com/kemayo/sublime-text-git which inspired SublimeGit. There are way more people using this, and it's been around forever. Personally I like mine better of course, but I realize that different people need different things :-)


Yes. Yes. Basically this doesn't differ at all from buying an audio workstation software (Reaper from Cockos) and a VST plugin (The Oddity from GForce). Coming from Linux and OSS just easily gives the first impression of "how dare they charge for that?!".

So, as I said: all good :)


Looks like a great job, and good man for giving a shout out to the free alternative as well. As an existing user of Kemayo's plugin, what are the most compelling reasons for me to buy your version? An elevator pitch, if you will.


I'd probably say the status view (ala magit). Last time I tried kemayo's plugin it was all happening in ST's quick bars. However, that was a year ago so things might have changed.

Also, I try my best to keep up with user requests, which leads to about 1-2 releases a month. While there are occasionally bugfixes going into kemayo's plugin, I'm not sure if it's receiving any significant development (not trying to call anyone out here, it's just my observation from occasionally looking at the repo).


Games that sell for 99 cents sell in much larger quantities than a niche product like SublimeGit. As for whether it should be included by default: SublimeGit isn't built by the authors of Sublime Text, but by an independent author - and he needs to get paid for his work, too.


You're right. Comparison to game prices was out of context.


Not actually forcing you to pay for use - at the bottom it says: "You can try out SublimeGit for as long as you'd like, and there are no feature restrictions."

So, just seems to be a dark pattern leading you to BELIEVE you have to pay. However, if you like it, pay for it.


I don't think it's fair to call dark pattern an unlimited free trial. He's selling it but allows you to try it, he's not deceiving you into paying for something that is free.


I am bit bummed that you have to pay for an editor. Yeah, it is just $70 / user, but still. You even get full games for 99 cents these days. And shouldn't this be a default program to write in the first place.

Anyway, no-one is forcing anyone to buy it, so all good.


Nobody mentioned https://github.com/kemayo/sublime-text-git Isn't this good enough? I've been using it for quite a while now.


I think I'm being dim but I don't understand what this is.

Does it prompt me for a commit message when I save code, with like a special CMD-Shift-S to push or something, or is it just using sublime as a GUI for git?


This is based on my experiences with Magit, so maybe this doesn't work quite the same with SublimeGit, but the thing I find most useful is the ability to select exactly which lines to stage in a commit. You can do this on the command-line with git add -p, but it's much easier and much more natural to do it in the text editor itself. Once you get used to doing this, it's hard to imagine going back.


> is it just using sublime as a GUI for git?

Basically just that, but with shortcuts for stuff like stage current file, commit, push, etc


Seems like this is more of an autocomplete for git commands than what I was hoping for - for instance in Jetbrains IDEs (pycharm, rubymine, intellij) the killer feature IMO is the ability to see inline highlights of diffs when I have work in progress, and to be able to do a project wide branch diff (e.g develop vs master) with a really nice multi-file diff explorer. It's the one feature keeping me using jetbrains over sublime text for large projects.


For the inline bits, that'd be GitGutter: https://github.com/jisaacks/GitGutter


I use it every day.

`shift + cmd + p --> qcc` for quick committing the file I just finished to edit is priceless.


On linux I really prefer Sublime + Git Gutter + Git Cola for the diff and actual git client.


Love this extension and have been using it for months. It doesn't quite offer the ability to do everything yet. But it does have an amazing interface for checking diffs of files, checking status (un/staged files), adding files and committing. It's such an improvement from the cli and much more convenient since you don't have to leave sublime. With it I have found myself committing more regularly, more accurately (not slopping multiple commits into one), and with better commit messages.


The existing git sublime plugin shows a diff when committing. That on it's own is enough to keep me using it instead of switching, which is a shame as this does everything else better


You can actually turn on verbose commit messages by using the setting git_commit_verbose. Have a look in the default config for SublimeGit. If you do that, it'll add the diff, and even syntax highlight it for you.


awesome, thanks. I have no idea why that wouldn't be on by default. Can't imagine anyone getting annoyed by having it there.


It's not on by default, because it's not the default when using git from the command line. If someone is new to git it might be a little scary to see a wall of text when committing.

I'm not sure that it's actually documented though, which definitely is an error on my part.


Definitely encouraging to see more polished premium Sublime plugins.


Just to show some love to the other authors of paid Sublime Text plugins (which I can remember right now):

LaTeXing: http://www.latexing.com/

Sublimerge: http://www.sublimerge.com/

SFTP: http://wbond.net/sublime_packages/sftp

SVN: http://wbond.net/sublime_packages/svn


I already use and highly recommend SFTP, and will definitely check out Sublimerge. Thanks for the tip!


Wow sublimerge looks great, thanks for the tip.


Feedback on site: adopt the same demo as http://www.sublimetext.com/, it's incredible.


I know... It's been on the todo list forever. Hopefully I'll get around to it soon. But to be honest, I'd much rather spend the time adding features to SublimeGit itself.


Very cool!

If you could add the ability to stage by line/hunk, perhaps from within the diff view, that would be pretty rad.

Also too bad that you can't initiate an interactive rebase using SublimeGit.

If I have to drop to the terminal for those two things (which I do quite frequently), realistically I'll end up just using the terminal for all git operations.


You can actually stage and unstage hunks from a diff view. With a diff view open, you can press + or - to increase or decrease hunk size, n/p and N/P for next/previous hunk/file, and s/u for stage and unstage.

Rebase is one of the big ones coming up.


I've been happy with SideBarGit: https://sublime.wbond.net/packages/SideBarGit

Lots more GIT options for Sublime: https://sublime.wbond.net/search/git


It's nice to see variety in plugins. However, if you're not willing to pay for this, have a look at the existing open source Git plugin for sublime: https://github.com/kemayo/sublime-text-git


What does this have over say, git gutter, which gives me at-a-glance change information to my current file?


This has committing, staging, pushing, pulling etc. Actually, a lot of people seem to be using this alongside GitGutter, since their functionality is very much complimentary. See this issue for instance: https://github.com/SublimeGit/SublimeGit/issues/27


Thanks. Think I prefer to keep my editor and git actions separate but appreciate the reply.


Any plans for mercurial integration?


Not at the moment, since I don't use mercurial myself. If there isn't a good mercurial plugin, then maybe that's for someone to look into? Writing a plugin for Sublime Text is quite pleasant (it's done in python).


If you like this, you should check out http://wakatime.us which is a free time tracker for Sublime that works with Git to display how much time you work in each project and even in each branch.


Looks interesting, but I'm turned off by 'sign up for free' when there's nothing on the page indicating the cost, if any, of using the product.

If it's free, 'sign up for free' suggests otherwise. If there's a cost, please be up front about it. If you haven't decided what or whether to charge, just say so ;)


Does anyone know if there is a good difftool for sublime? I'm always launching meld for complicated diffs, would love it this or some other addon could do side by side diff



I like to use P4Merge, it's the best merger/differ for code on OS X. Not the prettiest, but the merge workflow is good.


Check out kaleidoscope if you've got a few minutes to try out a new tool. Blew P4Merge out of the water for me. And BeyondCompare if you're on windows. Linux; sorry :(


Have you seen Sublimerge?


Our team has been using it for the last few months and absolutely love it. Best side effect is much more descriptive commit messages. Thanks @miped


Sweet! I love magit in my Emacs and this looks very similar. It certainly makes me want to try giving Sublime another whirl.


I use this mainly for "Git: Diff Current File". It's much easier to see in Sublime than Terminal for me.


You seems to be on Mac OSX, if that is the case, try out the file merger that comes with XCode, it's pretty awesome for doing both diffs and merges.

Screenshots of the software:

http://osxdaily.com/wp-content/uploads/2010/02/FileMerge-fil...

http://anoved.net/images/filemerge/filemerge.png

http://www.defraine.net/~brunod/fmdiff/filemerge.gif


I've always meant to check that out but always forget. Thanks for reminding me about that, I'll take a look now.


I love that interface in Xcode! Thanks for reminding me about FileMerge for non Xcode projects.


I just discovered that there is a nice plugin for visually diffing and merging files in Sublime Text (both 2 and 3) - Sublimerge (http://www.sublimerge.com/)


I posted above; and someone else said you were on a mac. Check out Kaleidoscope.


This package has improved my workflow dramatically! Thank you!


Just needs individual file status colors in left file tree.


Yup that would be a nice feature, but as of yet there's no way to do this within Sublime Text AFAIK.


How it differs from magit or fugitive except price? I've tried magit and fugitive for some time, but as for me, adding this plugins to workflow just complicates tasks related to VCS. At the time of this writing, whichever editor/IDE I use, my VCS stay in command line.


It is a little bit of a weird bastard child of the ideas in magit and fugitive, coming from vim and fugitive myself, but having always admired the workflow of magit. Mix that with whatever is possible interface-wise in Sublime Text, and you have SublimeGit.

I think it depends a lot on your workflow. If you're comfortable with, and used to, the command line this might not be for you. But for easy staging and committing of individual files/hunks I find it very useful. Also, even if you're just using Sublime Text as your commit message editor, this will give you color highlighting of you commit message, including gently nudging you towards good practices for commit messages.


Magit effectively has a plugin system too. I know the guy who wrote it.


> my VCS stay in command line

You probably don't realize how much this slows you down.


I have tried plenty of GUI clients, but I am the fastest with git in the command-line hands down. git has quite a good user interface for command line use with its hunk-based staging, drop to $EDITOR to quickly edit a diff, etc.

Also, there is completion for git in shells such as bash and zsh.


Can you explain how ?

I use git on the command line too, it fits well with my workflow (branch features, "commit -a" when it seems relevant, rebase/squash when ready).

Maybe a more complicated workflow could justify an IDE plugin, but for me CLI is fine.


Wow, this crap even charges 10 bucks?

There was a open source Git plugin for Sublime long time ago.

https://github.com/kemayo/sublime-text-git


Are you saying that because it's actually crap or you just don't want to spend money on software?


The point is there is already someone who has implemented the almost the exact same functionalities, and its code is open source. However, it seems like someone is still shamelessly trying to capitalize on it.


What makes it crap?

It's a brilliant plugin, with a great unlimited "trial". I've not came across any bugs, nor have I had any issues with it. So again, what makes it crap?


It's a crap because it's created by someone who is stupid enough to try recreating something that's already been created long time ago. Use it to capitalize on you sublime novices.


This is the great thing about having alternatives. If you don't want to use it, don't. If you prefer something else, use that.

Why does using a plugin make us novices? I'm proficient in Git and Sublime. I've written several plugins myself.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: