Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kenmueller/gitignore
.gitignore cheat sheet
https://github.com/kenmueller/gitignore
Last synced: about 2 months ago
JSON representation
.gitignore cheat sheet
- Host: GitHub
- URL: https://github.com/kenmueller/gitignore
- Owner: kenmueller
- Created: 2019-03-30T02:23:22.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-30T02:23:37.000Z (almost 6 years ago)
- Last Synced: 2024-05-28T15:29:22.372Z (7 months ago)
- Size: 0 Bytes
- Stars: 96
- Watchers: 1
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `.gitignore`
Create a `.gitignore` file in your root directory
## Ignoring single files
**Must specify filename and extension**
```bash
example.txt
```## Keeping single files
```bash
!example.txt
```## Multiple files with the same extension
```bash
*.txt
```## Multiple files with the same name
```bash
example*
```## Folders
```bash
examples/
```## Files inside of folders
**You can apply the same techniques for multiple files inside the root directory**
```bash
examples/example.txt
```## Everything inside of a folder except for some files
**When first ignoring the whole folder, you must have a star at the end.**
**The star means you are ignoring the files in the folder, while not having a star means that you are ignoring the whole folder**
```bash
examples/*
!examples/example.txt
```## Ignoring files in every directory
**This ignores all files named example.txt in every folder. You can use the same techniques for ignoring specific names or extensions with this syntax as well.**
```bash
**/example.txt
```## Ignoring files only in the root directory
**Must include a slash in the beginning**
```bash
/example.txt
```## Matching many characters
**This ignores files named `Example.txt` and `example.txt`. You can match against as many characters as you like at once.**
```bash
[Ee]xample.txt
```