首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >有东西一直在重写我的Gemfile.lock

有东西一直在重写我的Gemfile.lock
EN

Stack Overflow用户
提问于 2017-04-12 21:49:23
回答 1查看 2.1K关注 0票数 8

在进行共享项目时,我经常发现我的Gemfile.lock与存储库不同步,产生的错误消息如下:

代码语言:javascript
运行
复制
$ git pull
Updating 1911275..8c5d26f
error: Your local changes to the following files would be overwritten by merge:
    Gemfile.lock
Please commit your changes or stash them before you merge.
Aborting

当我尝试git stash更改时,它不起作用:

代码语言:javascript
运行
复制
$ git stash
Saved working directory and index state WIP on development: 1911275 Merge branch 'development' of https://github.com/mygroup/myrepo into development
HEAD is now at 1911275 Merge branch 'development' of https://github.com/mygroup/myrepo into development
$ git status
On branch development
Your branch is behind 'origin/development' by 3 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
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

no changes added to commit (use "git add" and/or "git commit -a")

如果我stashstatus足够快的话,我可以看到改变被藏起来了:

代码语言:javascript
运行
复制
$ git stash && git status
Saved working directory and index state WIP on development: 1911275 Merge branch 'development' of https://github.com/mygroup/myrepo into development
HEAD is now at 1911275 Merge branch 'development' of https://github.com/mygroup/myrepo into development
On branch development
Your branch is behind 'origin/development' by 3 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
nothing to commit, working tree clean

但是另一个status显示,Gemfile.lock已经回来了:

代码语言:javascript
运行
复制
$ git status
On branch development
Your branch is behind 'origin/development' by 3 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
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

no changes added to commit (use "git add" and/or "git commit -a")

不幸的是,同样的技巧不适用于git stash && git pullpull太慢了,在拉成功之前锁文件会重新出现。

我想这可能是我的IDE在后台重新绑定,但是不管IDE是否在运行,都会发生这种情况。我找不到任何正在运行的绑定进程、gem进程,或者任何类型的明显Ruby进程。

是谁或者是什么在重新生成我的文件?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-14 15:32:44

找到了罪魁祸首,多亏了这个答案 (这个答案赞同):春天。我的机器上有六个流氓spring进程,其中任何一个或所有进程都是重新生成文件的。杀死这些进程解决了问题,到目前为止,将export DISABLE_SPRING=1添加到我的.bash_profile似乎使其不再重复出现。

(spring stop可能也起作用了。我不知道它是停止了所有Spring进程,还是只停止了其中一个进程。)

票数 18
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43380205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档