How do I get the latest commit of public git repo in my gemfile?

in my gemfile i have the following

gem 'simple_form'

I want to grab the latest commit of simple_form. The current release version 2.1.0. But there are things in the latest commit that I would like to use.

  • Gemfile git branch for Beanstalk unable to bundle install
  • Accidentally created a git submodule
  • ERROR: Repository not found message given when following the instructions for Jekyll-Bootstrap
  • How to resolve error where gem from git repository “is not checked out. Please run `bundle install`”
  • “modified: Gemfile.lock”, Why?
  • Continuous integration for a gem?
  • How to set up db in Meteor.js?
  • Mirror a Git Repo directly to AWS CodeCommit
  • How do I branch out from an empty master branch
  • How to make git diff ignore comments
  • Difference between ** and * in glob matching (.gitignore)
  • How can i configure imported repository path in GitLab to remove root folder prefix?
  • 2 Solutions collect form web for “How do I get the latest commit of public git repo in my gemfile?”

    In Gemfile you can point a gem to its github path, something like this:

    gem 'simple_form', git: 'git://'

    This way it’ll point to the master branch, you can also define a specific branch with

    gem 'simple_form', git: 'git://', branch: 'some_branch'

    In addition to branch (as @Miguelgraz correctly suggests), you can point your Gemfile to a specific ref of a Git repo:

    gem 'simple_form', :git => 'git://', :ref => 'd7a661'

    Don’t forget to re-run bundle install.

    There’s more info at Bundler git reference.

    Git Baby is a git and github fan, let's start git clone.