Git: ignoring .htaccess… just not always -


here's scenario:

  1. i want track .htaccess in repo, since contains essential configuration.
  2. i want keep prying eyes away dev site, add http auth directives .htaccess in dev.
  3. during development, don't want git tell me .htaccess modified, nor want .htaccess included in git add -a command.
  4. i do, however, want option add , commit .htaccess. (if make changes should propagate production.)

what's best way this? advice.

to ignore changes in file, use

git update-index --assume-unchanged .htaccess 

this command sets flag on file such git treats if there no uncommitted changes file, regardless of contents of file working copy.

you need undo previous before can stage , commit new changes.

git update-index --no-assume-unchanged .htaccess git commit .htaccess 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -