If you are using Mac OS for development then you must have seen .DS_Store files created automatically which is quite painful. However there is a work around to delete it from an existing git repository using following few commands.
1 |
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch |
Above command will delete all .DS_Store files, and now you can add in .gitignore file to avoid commit of this file in future.
1 |
echo .DS_Store >> .gitignore |
Then
1 2 |
git add .gitignore git commit -m '.DS_Store banished!' |
You can also avoid creation of .DS_Store file through simple steps.
Comment Policy:
Your words are your own, so be nice and helpful if you can. Please, only use your real name, not your business name or keywords. Using business name or keywords instead of your real name will lead to the comment being deleted. Anonymous commenting is not allowed either. Limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.