Git gitignore untrack files
gitignore and untrack ignored files
- create .gitignore file: e.g.
echo .DS_Store >> .gitignore
# System OSX
.DS_Store
# Environment
.venv
# Specific folder
/data
# Mkdocs
/site/
-
untrack everything that is now in .gitignore:
- commit all changes
- remove everything from the repo:
git rm -r --cached .
(recursively remove all files from the index) or, remove a specific file:git rm --cached some.txt
- re add everything:
git add .
- commit:
git commit -m '.gitignore fix'
-
check files that are being ignored:
git status --ignored