Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitignore .DS_Store and similar files #4337

Merged
merged 2 commits into from Oct 26, 2022
Merged

Conversation

mattstein
Copy link
Sponsor Collaborator

@mattstein mattstein commented Oct 25, 2022

The Problem/Issue/Bug:

One might easily and accidentally commit those annoying macOS .DS_Store files to their commit, adding cruft to the project.

How this PR Solves The Problem:

This uses the .gitignore file to prevent those from being noticed or committed by Git.

Manual Testing Instructions:

馃 Stage this change, then purposefully try to commit a file named .DS_Store. It鈥檒l be trickier, at least.

Automated Testing Overview:

n/a

Related Issue Link(s):

Faintly related to #4188; came up during #4336.

Release/Deployment notes:

n/a

@mattstein mattstein self-assigned this Oct 25, 2022
@mattstein mattstein requested a review from rfay October 25, 2022 23:31
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing wrong with that, but I gitignore stuff like that in global gitignore, I recommend to you as well.

My global .gitignore:

.project
.buildpath
.settings
nbproject/
.idea
.DS_Store
db/db_*
docroot/core/phpunit.xml
docroot/drush
docroot/sites/simpletest
docroot/modules/contrib/devel
sites/default/files
*.orig
*.rej
.tarballs

@mattstein
Copy link
Sponsor Collaborator Author

Oh, that makes more sense! Thank you.

@tyler36
Copy link
Collaborator

tyler36 commented Oct 26, 2022

Yes, a global .gitignore is definately great.

However, I think for a project like DDEV that recieves lots of contributions, it's helpful to have a project level one too.

@rfay
Copy link
Member

rfay commented Oct 26, 2022

May want to add a couple more of those if we're doing this one.

@mattstein
Copy link
Sponsor Collaborator Author

I mean now that we鈥檝e trained me to use a global file, I won鈥檛 be noticing whatever those other things are! 馃槄 馃殌

@rfay
Copy link
Member

rfay commented Oct 26, 2022

Another pro tip: Always use git add -u when choosing changes for a commit. Then look and see what might be left over with git diff. The leftover stuff is normally cruft, unless you explicitly added a file, in which case git add <file>. If you use git add -u you'll almost never check in something you shouldn't have.

.gitignore Show resolved Hide resolved
Co-authored-by: Randy Fay <randy@randyfay.com>
@rfay rfay changed the title Ignore .DS_Store files Gitignore .DS_Store and similar files Oct 26, 2022
@rfay rfay merged commit 51ab505 into ddev:master Oct 26, 2022
@mattstein mattstein deleted the ignore-ds-store branch October 26, 2022 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants