git , how to accept rm file update without delete the file? -
i have local_settings.py in django prject, custom settings different each dev. yesterday, mistake commit conf/local_settings.py repo , push bitbucket. project new, think can not rollback because file committed @ first push,
remove local_settings.py repo without delete git rm --cached ./conf/local_settings.py.that works on local machine.
i meet error when git pull on vps.
..... >>> git pull origin master updating f1d56d3..6163ffb error: local changes following files overwritten merge: conf/local_settings.py please, commit changes or stash them before can merge. aborting how can make others not delete local_settings.py after pulling repo , update code automatically? new git , afraid go wrong if others merge themself in case.
my case example:
a has local_settings.py , b has local_settings.py, use origin master.
- a git init , push files. b pull. a, b change
local_settings.py, different. - a find
local_settings.pyshould not in repo. - a
git rm --cached ./conf/local_settings.py, , push commit. - (what need) b pull, remove
local_settings.pyb local repo without delete it.
other developers won't able pull version contains local_settings.py because git knows overwrite (untracked) version. after remove , push removal, other developers able pull again.
Comments
Post a Comment