How to ignore files which are in repository?

If the file is still displayed in the status, even though it is in the .gitignore, make sure it isn’t already tracked.

git rm --cached config.php

If you just want to ignore it locally, you could also make it ignored by the git status:

git update-index --assume-unchanged config.php

As commented, do note that using --assume-unchanged might cause unwanted data loss as git stash resets the “ignored” files to the state in upstream, undoing local changes, without a warning or saving.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)