Ignore everything in root directory for WordPress.gitignore #3378
Conversation
I think that first line was missing in the .gitignore, am I wrong? Thanks
Probably. Your change uses valid
so adding this
|
|
@LucasLarson Thanks for the feedback! I was not trying to add a php style comment, but trying to ignore everything in the root directory, except (the other lines that have a ! in front of it) This configuration (with the modification I added) works great on my windows machine with gitbash, but maybe my machine is a edge-case. Without it, all the files of WordPress core are tracked with the repo. With it, only the plugin / theme files are tracked (which is what I was looking for in my case) |
|
I don’t think this is production-ready yet.
If the user will already have to |
I'm on Git 2.23.0, and using this After adding Also,
|
|
This does exactly what it should (and doesn’t unnecessarily commit the entire WordPress installation to a repository). And mea culpa – it didn’t occur to me that we shouldn’t copy the entire installation. |
|
As I explain in #3295, I don't think the catch-all approach is the best for this .gitignore. |


Reasons for making this change:
I think that first line was missing in the .gitignore, am I wrong?
Links to documentation supporting these rule changes:
This first line in the current repository points to this ignoring everything in the root directory:
https://github.com/github/gitignore/blob/master/WordPress.gitignore#L1
Thanks