Skip to content
AutoGit is an automatic package manager for Ruby (alternative to RubyGems)
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib docs, docs, docs. Now AutoGit could be used inside libraries
spec added rewrite rules
README README: typos and wording


AutoGit is an easy way to require specific versions of libraries, stored in git repositories.
Basically, AutoGit is a smart and yet simple alternative to RubyGems. Any git-tracked gem can be required using autogit(url, commmitish) instead of gem(name, version).


  Instead of:

    system("sudo gem install oleganza-gem_console")
    gem "oleganza-gem_console", "0.1"
    require "gem_console"

  you write: 

    autogit 'git://', '0.1'
    require "gem_console"

  You can also specify any valid git commitish in place of version (e.g. "f2c55bd10cd9ca")
  Branch names are valid too, but don't expect AutoGit to update your branch heads automatically.
  After all, it is a bad practice to specify a branch head (the version is unknown in this case) 


  Suppose we have the following definition:
    autogit 'git://', 'f2c55bd10cd9cae14e5bf7bde523ac3a7b66561a'
  1. autogit creates a bare repository (--no-checkout):
  2. Clones local repository with --shared flag into:
  3. Checks out f2c55bd10cd9cae14e5bf7bde523ac3a7b66561a commit inside that repo
  4. Adds a checked out path to the $LOAD_PATH 
     If ./lib subfolder exists, it is used instead (i.e. gem-like load path)

  To clean a cache of checked out revisions: $ rm -rf ~/.autogit/checkouts 
  The library is very simple and could be easily extended whenever you need to. 
  The following code shows how a list of gems could be organized for different environments:

  sources = %w{
  libs = {
    "oleganza/declarations" => "f05be8ca8a77",
    "oleganza/autogit"      => "84b14f0df",
    "rails/rails"           => "2.2.2",
    "yrashk/strokedb"       => "0.2.1"

  libs.each do |path, commit|
    autogit({|s| s + path }, commit)


  1. Put all specifications into if defined?(AutoGit)...end block.
     This is crucial to let folks use your library without AutoGit (e.g. as a rubygem)
  2. Application may specify rewrite rules (AutoGit.rewrite) to modify URLs: remove,
     rewrite or append a mirror.
     (see comments in source code and examples/*.rb)


  - integration tests to cover all interesting cases

  1. It is a bad idea to check out branch heads, so i don't even try to implement automatic pull for checkouts.
  2. There is no executable script like "gem install" or "gem update". AutoGit is, huh, "auto". 
  3. To fix or optimize your repositories, go to ~/.autogit folder and use standard git tools.
  4. --quiet flag is not used to inform user when initial cloning or checkout is performed. Second run will not emit any
     verbose output.

  Author:   Oleg Andreev <>
  Date:     January 29, 2009
  License:  WTFPL
Something went wrong with that request. Please try again.