Gemfile.lock每当我想做一个git pull或结帐新分支时,我一直遇到以下错误.
error: Your local changes to the following files would be overwritten by merge:
Gemfile.lock
Please, commit your changes or stash them before you can merge.
Aborting
Run Code Online (Sandbox Code Playgroud)
问题是我无法弄清楚如何解决它.
git checkout -- Gemfile.lock以丢弃这些更改,但这也不起作用 - 本地更改只是停留在那里.Gemfile.lock更改提交给该分支......但这也不起作用.变化仍然存在!我需要做什么?我到目前为止只是克隆了一个新的git repo,但很快,所有这一切又开始了.
git ruby-on-rails merge-conflict-resolution gemfile gemfile.lock
我正在努力的rails应用程序上遇到这个问题.我正在开发一个功能分支,并希望从最新的主人那里重新定义.我运行了以下命令:
$ git checkout master
$ git pull --rebase
Run Code Online (Sandbox Code Playgroud)
如果我尝试检出我的功能分支,我会收到以下错误:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Gemfile.lock
Run Code Online (Sandbox Code Playgroud)
我尝试了以下命令将Gemfile.lock解析回aster,但没有一个成功:
$ git checkout -- Gemfile.lock
$ git stash
$ git reset HEAD --hard
Run Code Online (Sandbox Code Playgroud)
每次我运行一个新的git命令时,我都会回到Gemfile.lock,其中的更改没有为commit提交.
以下是我正在使用的以下版本的库:
$ git --version => 2.3.3
$ bundler --version => 1.7.9
Run Code Online (Sandbox Code Playgroud)