Troubles with git and Gemfile.lock

前端 未结 3 1512
孤城傲影
孤城傲影 2020-12-28 13:53

I keep running into the following error with my Gemfile.lock whenever I want to do a git pull or checkout a new branch.

error: Your         


        
3条回答
  •  情深已故
    2020-12-28 14:51

    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)

提交回复
热议问题