#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
🙈 FREE · 19 TEMPLATES

.gitignore Generator: Keep Junk and Secrets Out of Git

Tick your languages, editors and OS, and download a clean, de-duplicated .gitignore.

  • 🧩 Mix any templates
  • 🔁 Duplicates removed
  • 🔐 .env ignored by default

How to use the .gitignore Generator

  1. 1. Tick your stackChoose languages and frameworks, your editor and the operating systems your team uses.
  2. 2. Add your own linesType extra folders such as uploads/ or secrets/, one per line.
  3. 3. Download .gitignoreSave the file in the root of your repository and commit it.

What you get with the defaults

Node.js, VS Code, macOS and Windows are ticked when the page opens. The file starts with a Node.js block containing node_modules/, the npm, Yarn and pnpm debug logs, .env with !.env.example so a sample file can still be shared, and the dist, build and coverage folders. Then come .vscode/* with exceptions for shared settings, .DS_Store for macOS, and Thumbs.db and Desktop.ini for Windows.

If two templates contain the same line, such as dist/ in Node.js and Python, it appears only once, so the file stays short and readable. Each block has a ### heading so teammates can see why a rule exists.

How .gitignore rules work

  • A line like logs/ ignores a folder anywhere in the repository.
  • *.log ignores every file ending in .log.
  • A leading slash, as in /build, matches only at the top level.
  • A line starting with ! brings back a file that an earlier rule ignored.

.gitignore only affects files Git is not already tracking. If you committed a file by mistake, run git rm --cached file, commit, and then the rule takes effect. If that file held a password or API key, treat the key as leaked and rotate it, because it is still in the history. The Git commands cheat sheet lists the related commands, and the .env to JSON converter helps when you move settings between formats.

Frequently asked questions

Where do I put the .gitignore file?

In the root folder of the repository, next to the .git folder. You can also add more .gitignore files inside subfolders for rules that only apply there.

Should I ignore package-lock.json?

No. Lock files make installs repeatable, so commit package-lock.json, poetry.lock, go.sum and similar files.

Is the .gitignore Generator free?

Yes, the .gitignore Generator is free. The first time you generate your first .gitignore, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.

More free tools

See all free tools