我在我正在开发的 Rails 应用程序上遇到了这个问题。我正在开发一个功能分支,并想从最近的 master 中重新定位。我运行了以下命令:
$ git checkout master
$ git pull --rebase
如果我尝试结帐回我的功能分支,我会收到以下错误:
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
我尝试使用以下命令将 Gemfile.lock 解析回 aster,但均未成功:
$ git checkout -- Gemfile.lock
$ git stash
$ git reset HEAD --hard
每次我运行一个新的 git 命令时,我都会回到 Gemfile.lock ,其中的更改未暂存以进行提交。
以下是我正在使用的库的以下版本:
$ git --version => 2.3.3
$ bundler --version => 1.7.9