简体   繁体   中英

Removing .DS_Store from git repo

I keep getting both a.DS_Store file and a.ipynb_checkpoints folder everytime I push to my git repository. I've tried creating a.gitignore file, but they still don't go away when I do another commit. I have tried:

touch .gitignore
% echo '.ipynb_checkpoints' >> ~/.gitignore
echo .DS_Store >> .gitignore

Any help on how to remove these from the front page of my git?

Make sure you remove them from your Git repository first, while keeping them on your disk

git rm -r --cached .DS_Store
git rm --cached .ipynb_checkpoints

git commit -m "Remove ignored files"

Then you won't see them in your next commit, and the .gitignore will apply.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM