The inspirational .gitignore boilerplate
Files and directories that Git should ignore (for a general web project)
Download .gitignore
## .gitignore boilerplate v1.1.0 (2023-10-09) sandromiguel@sandromiguel.com
## Editor directory
**/.vscode
## Ignore NPM 'node_modules' directory
**/node_modules
## Ignore Composer 'vendor' directory
**/vendor
## Ignore log files
yarn-error.log*
## Yarn - Not using Zero-Installs
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
## Ignore .env file - secrets inside
.env
## Ignore NPM configuration file
.npmrc
## Ignore Miscellaneous
**/.misc
**/*.bak
**/storage
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 ~**