Feedback

Chat Icon

Learn Git in a Day

Everything you need, nothing you don't

Keep Junk Out of Your Repo
61%

Pattern Matching in a Nutshell

The .gitignore file uses simple patterns to match filenames and paths. Here are the most common ones:

A filename like *.pyc matches any file ending in .pyc, anywhere in the project. The * is a wildcard that means "anything".

A folder like __pycache__/ matches the folder and everything inside it. The trailing / tells Git this is a folder, not a file.

A specific file like .env matches exactly that filename in the project root.

A comment

Learn Git in a Day

Everything you need, nothing you don't

Enroll now to unlock all content and receive all future updates for free.