The inspirational .gitignore boilerplate
Files and directories that Git should ignore (for a general web project)
Download .gitignore
## .gitignore boilerplate v1.2.0 (2025-02-28) sandromiguel@sandromiguel.com
## Editor directory
**/.vscode
## Ignore Node.js and Composer dependencies
**/node_modules
**/vendor
## Ignore logs and debug files
**/logs
**/log
yarn-error.log*
npm-debug.log*
*.log
## PHPUnit result cache
.phpunit.result.cache
## Ignore generated files
*.map
*.bak
## Ignore environment file (secrets inside)
.env
## Ignore NPM configuration file
.npmrc
## Yarn - Not using Zero-Installs
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
## Ignore storage and miscellaneous files
**/storage
**/.misc
Here are some tips and tricks for working with .gitignore
files:
In a .gitignore
file, you can use the !
symbol to negate a rule. This means that a file or directory matching the negated rule will be included, even if it matches a previous rule. For example:
# Ignore all .txt files
*.txt
# Except for specific.txt
!specific.txt
You can use **/
to match directories recursively. For example:
# Ignore all .log files in any directory
**/*.log
To ignore an entire directory and its contents, use a trailing /
like this:
# Ignore the entire "logs" directory
logs/
The *
wildcard can be used to match zero or more characters. For example:
# Ignore all .bak files
*.bak
Want to contribute? All contributions are welcome. Read the contributing guide.
If you have questions tweet me at @sandro_m_m or open an issue.
This project is licensed under the MIT License - see the LICENSE file for details
**~ sharing is caring ~**