logo

How to ignore files in one project without modifying .gitignore

Simple, but effective

Joel Clermont
Joel Clermont
2025-11-25

We work with a number of Laravel teams to help them improve their codebase. I will occasionally want to create files in the project for my local development process, but not commit them.

I also don't want to modify the .gitignore file, which could impact other team members. And just leaving files uncommitted is a constant nuisance, and an easy thing to accidentally commit later.

While pairing with Aaron, he shared how he solves this same problem, and it was genius.

Basically, you have an exclude file inside the .git folder in your local repo that functions just like .gitignore, but is only for your local machine.

To get more details, examples and context check out Aaron's excellent post instead.

If you have ever faced this problem, it's well worth the read.

Here to help,

Joel

P.S. Could your project use a pair of Laravel experts?

Toss a coin in the jar if you found this helpful.
Want a tip like this in your inbox every weekday? Sign up below 👇🏼
email
No spam. Only real-world advice you can use.