I am trying to get rid of my "Changes not staged for commit", and my Gemfile.lock keeps re-appearing as an unstaged file. I believe this is because I updated bundler, because the changes are:
-
- BUNDLED WITH
- 1.10.5
First, these did not work, because Gemfile.lock would update itself:
git checkout -- Gemfile.lock
git stash save --keep-index --include-untracked
git stash drop
git reset HEAD
git clean -df
git checkout -- .
What worked was:
git update-index --assume-unchanged Gemfile.lock
Looks okay, running "git status":
On branch develop
Your branch is up-to-date with 'origin/develop'.
nothing to commit, working directory clean
I cannot run "git checkout origin/existing_branch"
error: Your local changes to the following files would be overwritten by checkout:
Gemfile.lock
Please, commit your changes or stash them before you can switch branches.
What is the best practice with Gemfile.lock? How can I pull new branches from a remote while ignoring it?