Visual Studio Git - Cannot ignore committed file and switch branches -
i'm working in visual studios tfs , have 3 branches. in our repo each branch has 2 solutions configs files. config files have been committed , need remain committed. however, on machine need change config files point correct db.
i've tried git update-index --skip-worktree app.config when go switch branches error message below:
also with
git rm --cached app.config it creates .gitignore file , when commited app.config removed repo don't want.
my goal ignore changes make file keep file in online git repo.
git update-index --skip-worktree hides changes being shown in index, doesn't make changes disappear. if switching branches git needs able update config file, local changes prevent doing (which true whether or not file hidden index).
this workflow have been using lately:
- create branch local testing commits only. i'll call
test. commit config changes there. - do work on local branch normal. i'll call
work. commit small changes go (which practice anyway). - when need run tests updated config file, checkout
test, rebase on top ofwork. (if doing lot can settesttrackworksave keystrokes.) - once
teston top ofwork, cangit checkout testuse modified configs, orgit checkout workresume coding. - when ready publish changes,
rebase --interactivesquash of temp commits 1 (or more) official change(s). pushwork, , leavetestalone until need local changes again.
Comments
Post a Comment