Bundler: always use latest revision of git branch in Gemfile

I have a Gemfile with a private git repo in the following format:

gem 'magic_beans', :git => "git@git.example.com:magic_beans.git', :branch => 'super_beans'

  • Why doesn't the command `gem list` include gems installed with bundler's :git option?
  • Building pry plugin(gem) with bundler
  • Gemfile.lock not checked in - Heroku
  • Using Bundler with Git, is https:// or git:// better?
  • How to do bundle install using specific rvm gemset from git hook post-receive?
  • Gems not found by 'gem list' when using 'bundle install' for git gems with RVM
  • When I bundle install, the Gemfile.lock locks it to a specific SHA revision.

    Can I get bundler to always check and use the latest SHA commit and/or update the Gemfile.lock? Notice that when I push updates to the super_beans branch I am not modifying the gem version.

    Ideally, every time I run bundle it would check upstream git repo for a newer SHA revision of the branch.

  • Git: merge to master, then push back to all branches
  • Why does git status for a particular repo return paths relative to the root instead of the current directory?
  • Git tagging questions
  • Can I make “git gui” pass, say, “--patience” to “git diff”?
  • Adding Git repository to Perforce depot
  • Path error on Atlassian Bamboo SSH deployment to Heroku
  • 3 Solutions collect form web for “Bundler: always use latest revision of git branch in Gemfile”

    This isn’t how bundler works.
    The point is to allow seamless versioning of dependencies.
    (particularly so you know exactly what version of the code is deployed at any given time).

    If want the latest version, you should just run.

    bundle update magic_beans

    This is exactly the same functionality as if you just say

    gem "rails"

    I’d suggest though, if you have a range of specific things you want to update
    then add a custom binary (say an executable file named bundle_update)

    #!/usr/bin/env bash
    bundle install
    bundle update magic_beans

    Then just do a ./bundle_update when you want to update these things.

    You can run bundle update to update all or specific gems to their latest available version, as stated in the docs.

    Would that help?

    After searching through the documents I finally found the magic way to do this:

    bundle update magic_beans --source magic_beans

    That is to update the magic_beans gem only, but not to touch other locked gems. The doc about this is: http://bundler.io/man/bundle-update.1.html

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