Gems from git repositories

Specify that a gem should come from a git repository with a .gemspec at its root
gem 'nokogiri', :git => ''

If there is no .gemspec at the root of a git repository, you must specify a version that bundler should use when resolving dependencies
gem 'deep_merge', '1.0', :git => ''

Specify that a git repository containing multiple .gemspec files should be treated as a gem source
git ''
gem 'railties'
gem 'action_pack'
gem 'active_model'

Specify that a git repository should use a particular ref, branch, or tag
git '', :ref => '4aded'

git '', :branch => '2-3-stable'

git '', :tag => 'v2.3.5'

Specifying a ref, branch, or tag for a git repository specified inline works exactly the same way
gem 'nokogiri', :git => '', :ref => '0eec4'

Bundler can use HTTP(S), SSH, or git
gem 'nokogiri', :git => ''
gem 'nokogiri', :git => ''
gem 'nokogiri', :git => 'git://'


http:// and git:// URLs are insecure, and should be avoided if at all possible. These protocols are unauthenticated, so a man-in-the-middle attacker can tamper with the code and compromise your system.
Edit this document on GitHub if you caught an error or noticed something was missing.