In my case, l have a database config file database.php
and a hook to deploy the project.
l need to modify the database.php to connect my local database, but l don't want to push it to remote, because it will affect the dev env by hooking.
l tried to use git rm --cached -r database.php
to untracked the file, but it will delete this file at remote git server. so my dev server will also delete this file.
then, dev server BOOM.
l also tried git update-index --assume-unchanged database.php
, but it is not suitable my case so well.