How to Delete and Ignore All .ipynb_checkpoints in GitHub Repositories

Hongtao Hao / 2022-03-05


The procedure is very similar to delete .DS_Store File .

You can delete .ipynb_checkpoints folder this way:

find . -name .ipynb_checkpoints -print0 | xargs -0 git rm -rf --ignore-unmatch
git add .
git commit -m "Remove .ipynb_checkpoints from everywhere"
git push

Then you can ignore all future .ipynb_checkpoints this way:

touch .gitignore
echo \.ipynb_checkpoints >> .gitignore
git add .
git commit -m "Creating .gitignore and ignore .ipynb_checkpoints"
git push

Last modified on 2022-05-18