Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save raymelon/e19e19ccc010cabe083e60843a2d0ec3 to your computer and use it in GitHub Desktop.

Select an option

Save raymelon/e19e19ccc010cabe083e60843a2d0ec3 to your computer and use it in GitHub Desktop.
Untrack / Track a file after adding to gitignore, not delete
# source: https://superuser.com/a/1655712/454512
#
# to untrack (future versions will not be included on git)
git update-index --assume-unchanged <file>
# to track again (future changes will be included by git again)
git update-index --no-assume-unchanged <file>
# to view untracked files
# posix
git ls-files -v | grep ^[h]
# to view untracked files
# windows
git ls-files -v | find "h "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment