On my machine, I've set --skip-worktree
to config/database.yml
.
git update-index --skip-worktree config/database.yml
Another developer has committed and merged into the develop branch changes to config/database.yml
while working on the project.
Now, when I do git pull origin develop
, I get
Andrews-Air:[project] agrimm$ git pull origin develop
From bitbucket.org:[company]/[project]
* branch develop -> FETCH_HEAD
Updating [SHA]..[Another SHA]
error: Your local changes to the following files would be overwritten by merge:
config/database.yml
Please, commit your changes or stash them before you can merge.
Aborting
How should I handle such a change? Should I do
git update-index --no-skip-worktree config/database.yml
git stash save "Save changes to config/database.yml"
git pull origin develop
git stash apply
# Fix any conflicts
git update-index --skip-worktree config/database.yml
Or is there a less hacky approach?