So I am developing a rails app my_app, and simultaneously developing a rails engine my_engine that my_app mounts.
Gemfile
gem 'my_engine', git: https://my.repo/my_engine, branch: "development"
Of course, to see changes to my_engine inside of my_app live, while I develop, I have instructed bundler to use the local copy of my_engine I am developing instead of the git repository listed in my Gemfile.
$ bundle config set local.my_engine path/to/my_engine
This works great. Except for one little annoyance. If I am developing a new feature with a new branch checked out in my_engine, bundler will complain and stop every time I have to restart my_app:
Local override for my_engine at path/to/my_engine is using branch FEATURE-X but Gemfile specifies development
The current solution is to either change the branch in Gemfile to FEATURE-X (and back again when that branch is merged) or to temporarily checkout development in my_engine, start my_app and then checkout FEATURE-X again. This gets tiring fast.
In the same way that I have told bundler to ignore the git remote repo and use a local path, is there a way to tell bundler to ignore the checked out branch on my local machine?
This is intentional I'm afraid, from the docs: