Git Bundle

You may have read that a lot of prominent people have recently moved to Git and are loving it. I too am one of those who fancy this new kid on the block but never got very far with the bundle I started for it.

Fortunately Tim Harper recently picked up on my initial efforts and has done a great job at not only making this bundle functional but also downright impressive :)

The much improved Git bundle can be found at Gitorious and discussion about it can be directed to its Google Group.

For those too lazy to click the link above, here are the short install instructions:

mkdir -p /Library/Application\ Support/TextMate/Bundles
cd !$
git clone git://gitorious.org/git-tmbundle/mainline.git Git.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'

After having installed it you can press ⌃⌘T in TextMate and enter git to find the “Administration → Update Git Bundle” action. Use this to update the bundle (it will automatically reload after having performed the update).

47 Comments

  1. 21 Feb 2008 | # Kevin Teague wrote…

    There is a nice Mercurial bundle as well, but it's in the TextMate subversion repo so you need svn to get it – oh, the irony! :)

    http://macromates.com/svn/Bundles/trunk/Bundles/Mercurial.tmbundle/

  2. 21 Feb 2008 | # A Fresh Cup » Blog Archive » Double Shot #149 wrote…

    [...] Git Bundle – TextMate bindings for the new sexy source control system. With prominent projects moving to Git, I probably should figure this stuff out. [...]

  3. 21 Feb 2008 | # Chris Rohde wrote…

    Hmm, after updating git bundle all the options are grayed out. Did you get a different result?

  4. 21 Feb 2008 | # Ben wrote…

    Chris: do you have a file open in the editor? Most bundles are only active when one or more files are being edited…

  5. 21 Feb 2008 | # Chris Rohde wrote…

    Ben: thanks, had the app open, but hadn't selected a file. Its early, still on the first mountain dew.

  6. 21 Feb 2008 | # Petar wrote…

    I have Git installed and installed the bundle also. But when I try to update I get:

    /tmp/temp_textmate.Fw1Xhs:6: command not found: git pull
    

    Someone else also have this?

  7. 21 Feb 2008 | # Ximo wrote…

    This was just what I needed, thanks!

    @Petar: I didn't get any errors when updating the bundle, might be a problem with your installation of git.

  8. 21 Feb 2008 | # Petar wrote…

    I figured out the problem. My git was located in: /usr/local/bin

    I hade to make a link to it in my /usr/bin with ln -s. After that everything worked.

  9. 21 Feb 2008 | # Tim Harper wrote…

    I've pushed an update to "polish up" the update bundle command. It should fix your problem. If not, try setting the TM_GIT environment variable under the TextMate preferences dialog to point to "/usr/local/bin/git"

    That'd be much preferred over the symlink fix.

    I'm pleased that all are enjoying the git bundle.

    Tim

  10. 22 Feb 2008 | # tonyk wrote…

    Tim, thanks for this – I'm very impressed with this bundle.

    I too still have to set the TM_GIT variable to get it to find git, even though /usr/local/bin is in PATH when I run a shell script from TextMate. This is with commit 583ed4ec, the latest at this time.

  11. 26 Feb 2008 | # FredB wrote…

    There is a nice Mercurial bundle as well, but it’s in the TextMate subversion repo so you need svn to get it – oh, the irony! :

    Fair enough. ;) You can take a look at the mercurial repo of the bundle here. And now you can:

    mkdir -p /Library/Applications\ Support/TextMate/Bundles 
    cd !$
    hg clone http://mercurial.intuxication.org/hg/mercurial-tmbundle Mercurial.tmbundle
    osascript -e 'tell app "TextMate" to reload bundles'
    
  12. 27 Feb 2008 | # Louis Theran wrote…

    Awesome! I've been waiting for this for a while.

  13. 27 Feb 2008 | # Nick wrote…

    Hi, do the git commands work across multiple sub-directories? I installed the bundle and opened up a Rails app, but it only seemed to work for the files in the root directory where the .git is located. Is this by design? or am i missing something? Thank you!

  14. 28 Feb 2008 | # Bjorn wrote…

    For me it works for all files in a project if I open the folder that contains the .git files in Textmate. If I open a single file further down the tree, I get all kinds of errors.

    Doesn't bother me, since the first way is the way I work anyway :)

    Thanks for this post, it inspired me to try out git and it's absolutely perfect for what I'm doing.

  15. 28 Feb 2008 | # Rails Podcast Brasil - Epis wrote…

    [...] Git Bundle [...]

  16. 29 Feb 2008 | # Solutions Log > Installing Git on OS X Leopard wrote…

    [...] TextMate Blog [...]

  17. 05 Mar 2008 | # Git vs Mercurial - Why I chose Git wrote…

    [...] I first heard about distributed version control systems from Allan Odgaard on the TextMate blog. [...]

  18. 05 Mar 2008 | # Rob Hudson wrote…

    Cool! When will it be added to http://macromates.com/svn/Bundles/trunk/Bundles?

  19. 10 Mar 2008 | # Rob Cowie wrote…

    Any plans to add patch commands to the bundle?

    cheers :)

  20. 01 Apr 2008 | # Rails Podcast Brasil - Episódio 7 wrote…

    [...] Git Bundle [...]

  21. 04 Apr 2008 | # Jaremy Creechley wrote…

    After installing the Git bundle and it doesn't seem to appear. I had a previous Git bundle installed which is I deleted. A Haskell bundle installed in the same location is found. I am unsure what to do or how to figure out what is different.

    Thanks

  22. 13 Apr 2008 | # Fredrik Friele wrote…

    This is what I get when trying to update, even though I can ping the host.

    Updating git bundle

    gitorious.org[0: 67.207.146.32]: errno=Host is down fatal: unable to connect a socket (Host is down)

  23. 18 Apr 2008 | # reality » Blog Archive » 網摘 - Rails on Git (持續更新) wrote…

    [...] Textmate Git Bundle [...]

  24. 17 Jun 2008 | # Daniel wrote…

    How do I suggest to the author of Mercurial bundle to add tag support???

  25. 08 Jul 2008 | # Switching to Git wrote…

    [...] And of course, TextMate support: Git Bundle [...]

  26. 02 Aug 2008 | # Monkey’s thumb » Blog Archive » Using Git with Subversion: Part I (Installation) wrote…

    [...] If you use TextMate then install the Git Bundle [...]

  27. 18 Sep 2008 | # Sean wrote…

    I'm trying to push to a remote ssh server that prompts for a password every time. Is there a way to configure TM to know the password? It doesn't prompt me, it just says "permission denied" right now.

  28. 27 Sep 2008 | # Blog DETIK.COM Arie Keren » Blog Archive » MESRA TEXTMATE GIT BUNDLE wrote…

    [...] Ikuti aja dari sini biasanya pasti langsung jalan deh. [...]

  29. 18 Nov 2008 | # What Git does best. — Conceptric wrote…

    [...] a good TextMate bundle to support Git, but to be honest I've mostly used the [...]

  30. 21 Nov 2008 | # candide wrote…

    this is great but… how do I add/rm files to the git project (I mean the equivalent of "git add somefile")?

  31. 02 Dec 2008 | # theIntuitonist wrote…

    A really great feature would be to place the branch name in the title bar along with the project name. I forget to switch branches from time to time, a problem i've solved on the command line by changing my command prompt to list branch name along with directory when in a git repo.

  32. 04 Feb 2009 | # Alex Leverington wrote…

    Thanks for the copy and paste instructions :)

  33. 23 Feb 2009 | # Issac Trotts wrote…

    Hmm, I'm not sure what to make of this. When I click Commit, it brings up a dialog box saying "Choose files to commit:" that includes the current Python file I'm working on "factor_graph.py" and (unhelpfully) the associated "factor_graph.pyc", but for some reason there seems to be no way to also commit "factor_graph_test.py" at the same time. There should be some way to commit multiple source files at once.

  34. 23 Feb 2009 | # Issac Trotts wrote…

    Here is my replacement for the commit command that does what I was hoping. I'm sure you can do a better version of it, so let's call this version 0:

    result=$(CocoaDialog textbox –title "Commit" \ –editable \ –informative-text "Message:" \ –button1 "Okay" –button2 "Cancel")

    num_part=$(head -n1 <<<"$result") message=$(tail -n1 <<<"$result") [[ $num_part == "2" ]] && exit_discard

    echo "$message" | git commit -a -F – | pre

  35. 06 Jun 2009 | # Praktische Ressourcen zum Einstieg in Git zur Versionsverwaltung » Blog » BEIER-CHRISTIAN.eu | Christian Beier // design+foto wrote…

    [...] Git Bundle für TextMate [...]

  36. 21 Jun 2009 | # YK wrote…

    I'm a bit confused. Keeping in mind I'm a total git newb, I ran git init on my rails app folder, did the initial add via git add . and then opened the project in textmate. The bundle works correctly and seems to pick up changes, but how in the hell do I get it to add new files?! I just have a question mark beside them.

  37. 21 Jun 2009 | # Allan Odgaard wrote…

    YK: Click the check box next to the files you wish to add, to include them in the commit.

  38. 26 Jun 2009 | # YK wrote…

    Ha! I thought I had tried that but apparently not. I think I was confused because the question mark remains, unlike subversion which replaces the question mark with an A when it realizes you're adding a new file. Anyway, it worked, but seems like this bundle still needs some finessing. I also laughed when it texted me to add .gitignore to my repository. :) Cheers.

  39. 23 Sep 2009 | # Troex Nevelin wrote…

    Looks like it have problems when git colors are set to "always", especially with git config color.diff

  40. 25 Sep 2009 | # Textmate and Git Bundle | Chris J Mears wrote…

    [...] just recently had this problem and saw that the answer was buried in a TextMate blog entry comment [...]

  41. 01 Nov 2009 | # gish wrote…

    I pulled down the git bundle and when I ran the osascript command I received the following error:

    dko-macpro:Bundles derik$ osascript -e 'tell app "TextMate" to reload bundles' 2009-10-31 21:58:23.260 osascript[8592:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper osascript: OpenScripting.framework – scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers. dko-macpro:Bundles derik$ osascript -e 'tell app "TextMate" to reload bundles' 2009-10-31 21:58:41.197 osascript[8598:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper osascript: OpenScripting.framework – scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.

    Whenever I tried to run the git bundle update I receive the following errors:

    2009-10-31 22:09:20.282 osascript[8744:613] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper osascript: OpenScripting.framework – scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers. Already up-to-date.

    Whenever I try to commit the macro hangs… any idea what could be going on? I set TM_GIT to /usr/local/git/bin/git (that's where which tells me it is)

  42. 01 Nov 2009 | # Allan Odgaard wrote…

    gish: See item 9 here.

  43. 02 Nov 2009 | # gish wrote…

    that fixed the first issue but the git bundle update still errors out and the macro still hangs any time I try to commit.

  44. 02 Nov 2009 | # Allan Odgaard wrote…

    gish: If you installed your own 64 bit ruby then that might make the commit window hang (this is also mentioned on the page I linked to).

    If the update still gives same error, then the OSAScript extension must still be there.

    That said, blog comments are not suitable for support like this. Please write the mailing list or support if you have further problems, but also do checkout the troubleshooting section.

  45. 02 Dec 2009 | # Dan wrote…

    Love the plugin! Awesome!

    However, since upgrading to Snow Leopard, when I select a file in textmate and ctrl-shift-g and then select log, I always get a blank set of log entries.

    The log on the whole project works fine however.

    I got a colleague who also moved up to snow leopard to test this, and he got the same. Also got someone who did NOT upgrade, and his single file log entries were fine.

    Is it just us, are we going mad?

  46. 02 Dec 2009 | # Allan Odgaard wrote…

    Dan: Presumably the output from git log on Snow Leopard for single files is somehow changed and breaks the log parser in the Git bundle.

    Presently not on Snow Leopard so can’t easily test. Best way to report this would be the Google Group linked to in the blog post — or if you have enough info to pinpoint the bug, the issue tracker.

  47. 09 Jan 2010 | # Git auf Mac OS X (Teil 2): Grafische Frontends und Clients wrote…

    [...] dass sich der Funktionsumfang durch Bundles schier endlos erweitern lässt. So auch mit einem Git-Bundle, das ermöglicht direkt aus TextMate heraus eine Vielzahl von Git-Kommandos auszuführen und eine [...]

Comments closed, you can use the mailing list for discussion.