Stop tracking a file without deleting it

Bash

For the config file that should never have been committed. Add it to .gitignore afterwards.

git rm --cached config/local.json
echo 'config/local.json' >> .gitignore
git commit -m 'stop tracking local config'

More in Git

Random picks