Troubles with git and Gemfile.lock

坚强是说给别人听的谎言 提交于 2019-11-30 04:16:24

This happened to me and git reset --hard HEAD from the accepted answer didn't help. However, running spring stop did the trick. I suspect spring is rewriting the file whenever it is modified to ensure that it is in sync with the code running via spring.

After doing the following, I was able to pull and check out branches again.

git checkout Gemfile.lock
git reset --hard HEAD

I'm not sure why and how this solution works. Explanations are welcome.

The reason git was detecting Gemfile.lock as modified in my case, was that the bottom of the file had BUNDLED WITH 1.10.3. After updating bundler gem update bundler, regenerating and committing Gemfile.lock, it stopped appearing in git as modified.

git version 2.2.1, Mac OSX version 10.10.4, iTerm2 Build 2.9.20150624-nightly (w/shell integration)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!