See: https://bundler.io/guides/git.html

Specify that a gem should come from a git repository with a .gemspec at its root

gem 'rack', git: 'https://github.com/rack/rack'

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 'nokogiri', '1.7.0.1', git: 'https://github.com/sparklemotion/nokogiri'

If the gem is located within a subdirectory of a git repository, you can use the :glob option to specify the location of its .gemspec

gem 'cf-copilot', git: 'https://github.com/cloudfoundry/copilot', glob: 'sdk/ruby/*.gemspec'

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

git 'https://github.com/rails/rails.git' do
  gem 'railties'
  gem 'actionpack'
  gem 'activemodel'
end