git avoid files from being committed code example
Example 1: git ignore updates to file
git update-index --skip-worktree path/to/file.txt
Example 2: how to git ignore a file
git config --global core.excludesfile ~/.gitignore_global
git update-index --skip-worktree path/to/file.txt
git config --global core.excludesfile ~/.gitignore_global