When do bundler update the gem incase of gems pointed to git repo?

bundler, ruby, ruby-on-rails-3, rubygems

Solution

You do not need to change the version inside the gem every time you make a change to it. When using git gems, `Gemfile.lock` locks to a commit hash rather than the version number. You don't need to specify a version at all.

When you run `bundle update mygem` and `mygem` is a git gem, it will update the locked commit hash to the latest available on the branch you have specified (or on `master` if you have not specified a branch).

Problem

I am trying to move the common functionality of 3 Rails application into a gem. I have created the gem, tested it locally and is going to move to a private repository. So, now I am concerned about how to deal with case if I have change in the code inside the gem. Do I need to change the version of the gem, if I want to update the gem while `bundle update mygem`, or will Bundler detect the change from the commit hash of the git repo while doing `bundle update mygem`?

Original source