Developers

.gitignore Generator

Start every repository with a clean .gitignore. Pick your languages, frameworks, editors and operating systems, and get one combined, de-duplicated file to copy or download.

AdvertisementAd slot: leaderboard-top

Embed this tool

Put this free .gitignore Generator on your own website — copy the code below and paste it into your page's HTML.

AdvertisementAd slot: in-content

How to generate a .gitignore

  1. Select every language, framework, editor and operating system used in the project.
  2. Review the combined file and edit it if needed; duplicates are removed automatically.
  3. Copy it or download it, and save it as .gitignore in the root of your repository.

What belongs in a .gitignore

A .gitignore keeps generated and machine-specific files out of version control: dependencies (node_modules, venv), build output (dist, target, bin), caches, logs, editor settings and operating system clutter such as .DS_Store and Thumbs.db. Keeping these out makes repositories smaller and diffs cleaner.

Never commit secrets. The templates ignore .env files by default; commit a .env.example with placeholder values instead. If a secret was already committed, adding it to .gitignore is not enough: rotate the secret and remove it from history.

Patterns ending in / match directories, * matches any characters, ** matches nested directories, and a leading ! re-includes a file. Files already tracked by Git are not affected until you run git rm --cached on them.

Need a different tool? Suggest it here — we read every message.

Frequently asked questions

Where do I put the .gitignore file?

In the root of your repository. You can also add more .gitignore files in subfolders.

Why is a file still tracked after adding it to .gitignore?

Git keeps tracking files it already knows. Run git rm --cached path/to/file and commit.

Should I commit lock files?

Yes for applications: package-lock.json, yarn.lock, poetry.lock and Cargo.lock make builds reproducible.

Should .vscode or .idea be ignored?

Usually personal settings are ignored, but shared configs such as .vscode/extensions.json can be committed.

Related tools & templates

AdvertisementAd slot: footer-leaderboard