Free · No sign-up · Data stays local

gitignore Generator

Tick your stack and OS, get a merged .gitignore in real time, sectioned by template and ready to download.

生成的 .gitignore

How to Use

  1. Tick your stack

    Select the languages, frameworks, OS and editor your project actually uses; the right pane regenerates as you tick, no button needed.

  2. Use the shortcuts

    Select all gives you everything to trim by hand; Common set gives the usual Node + Python + macOS + VS Code + secrets combination.

  3. Download or copy

    Download .gitignore writes the file (browsers may save it as gitignore.txt — just rename), or copy and paste it into the repo root.

FAQ

Why is a file still committed despite .gitignore?

Because the rules only apply to untracked files. Anything already in the index stays tracked; run git rm --cached <file> inside the repo to pull it out (--cached keeps your local copy) and commit that. For a whole directory use git rm -r --cached <dir>.

Should .vscode be committed?

For team projects, commit the shared settings — settings.json, extensions.json, launch.json — so formatting rules and debug configs match. Personal preferences (paths, keys, local server config) stay in your own workspace. That is why the template uses .vscode/* plus three ! exceptions.

What does a leading ! do?

It negates, re-including a file an earlier rule excluded. Note it cannot rescue a file inside an excluded directory — if the parent is ignored, the ! rule inside it has no effect; you must un-ignore the directory first, then the file.

Should Cargo.lock and package-lock.json be ignored?

Commit them for applications, optional for libraries. Lockfiles pin everyone to identical dependency versions and let you reproduce a production build; when publishing a library they mean little to consumers and can mask version conflicts. So this template does not ignore them by default.

More Online Tools