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:

output visual studios

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:

  1. create branch local testing commits only. i'll call test. commit config changes there.
  2. do work on local branch normal. i'll call work. commit small changes go (which practice anyway).
  3. when need run tests updated config file, checkout test , rebase on top of work. (if doing lot can set test track work save keystrokes.)
  4. once test on top of work, can git checkout test use modified configs, or git checkout work resume coding.
  5. when ready publish changes, rebase --interactive squash of temp commits 1 (or more) official change(s). push work, , leave test alone until need local changes again.

Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -