In this case I want to ignore the files iOS uses, and in particular this file
.DS_Store
I created a .gitignore file as such
touch .gitignore
and put in a single line
/.DS_Store
I push to a bare repo which has a hook to checkout to a full repo.
The file keeps showing up in my full repo.
gitignore ignores only untracked files. Your files are marked as modified - meaning they were committed in the past, and git now tracks them. To ignore them, you first need to delete them, git rm them, commit and then ignore them.
DS_Store file in your directories. It's not a big issue, but often you need to exclude these files explicitly in your . gitignore file, to prevent any unnecessary files in your commit. You may want to ignore this file globally, so next time you don't need to add it to your project's ignore list.
gitignore file is usually placed in the root directory of a project. You can also create a global . gitignore file and any entries in that file will be ignored in all of your Git repositories. To create a local .
You can also remove committed .DS_Store
files like this: git rm --cached .DS_Store
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With