I have a new repo and before I perform the first commit I'd like to ignore .DS_Store files.
I've tried adding the following to the .gitignore file via Tower:
.DS_Store
*.DS_Store
*/.DS_Store
But only the .DS_Store file at the root is ignored, all others are included ready for commit.
Is there a trick to getting these files to be ignored?
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 , can be ignored using explicit repository excludes in your_project_directory/. git/info/exclude . This file will not be shared with other developers, and is specific for that single repository.
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
try it out :) Hope it help
Make sure you didn't add to the index those DS_Store first.
If you did, check out "How Can I Remove .DS_Store Files From A Git Repository?", and then check if your .gitignore
works.
Use git rm --cached
if you want just to remove then from the index while keeping them in the working tree.
Note: only .DS_Store
should be enough in your case.
See Objective-C.gitignore
from the GitHub Collection of Useful .gitignore
Templates.
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