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.

  1. a git init , push files. b pull. a, b change local_settings.py , different.
  2. a find local_settings.py should not in repo.
  3. a git rm --cached ./conf/local_settings.py, , push commit.
  4. (what need) b pull, remove local_settings.py b 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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -