Gemfile.lock always has changes not staged for commit

后端 未结 2 946
后悔当初
后悔当初 2021-02-14 19:17

I am running into this problem on a rails app I am working on. I was working on a feature branch and wanted to rebase from the most recent master. I ran the following commands:<

2条回答
  •  后悔当初
    2021-02-14 19:25

    There must be some process running in the background or some side-effect of executing the git commands in your shell that is modifying the Gemfile.lock.

    I am not familiar with rvm's magic (although that sounds plausible); here are some other things to check:

    • In recent versions of Rails there is a "spring" background process that runs. Try running spring stop (or bin/spring stop or bundle exec spring stop) to gracefully terminate that process.
    • Likewise if you have any other Rails-related processes like rails server, guard, zeus, sidekiq, etc. running, try shutting those down.
    • You might be running a git pre-commit hook. Check the .git/hooks directory.
    • git might be an alias in your shell for another command. Run alias to see a list of shell aliases.
    • Your shell prompt might be executing code to do things like show the current git status and branch name in the prompt. This code would be executed after every shell command to redraw the prompt, and might have side-effects. Check your .bashrc or .bash_profile.

提交回复
热议问题