Skip to content

Instantly share code, notes, and snippets.

@Abir-Tx
Last active April 21, 2021 21:38
Show Gist options
  • Save Abir-Tx/fdf32b0108efddfb83a0cfdb76ff6261 to your computer and use it in GitHub Desktop.
Save Abir-Tx/fdf32b0108efddfb83a0cfdb76ff6261 to your computer and use it in GitHub Desktop.
Git ignore or remove tracked file

Ignore future changes of a tracked file

  • To ignore changes of tracked file
git update-index --assume-unchanged <file>
  • To start tracking changes of file again:
git update-index --no-assume-unchanged <file>

Remove file from being tracked

git rm --cached <file>
git commit -m 'chore: remove file'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment