在我的机器上,我设置--skip-worktree
为config/database.yml
.
git update-index --skip-worktree config/database.yml
另一位开发人员在处理项目时已提交并合并到开发分支更改config/database.yml
。
现在,当我这样做时git pull origin develop
,我得到
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
我应该如何处理这样的变化?我应该做
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
还是有一种不那么老套的方法?