Type a tool name, for example "keyword density" or "transcript".
Build a .gitignore from 60+ templates, then refine with custom ignore and force-include rules.
Glob patterns: * matches anything, ** matches paths, / at end matches a folder.
Each line becomes an exception ("!pattern"). Parent directories are reopened too. Review which sibling files this also makes visible before using the rules.
This free gitignore generator builds a ready-to-use .gitignore file from more than 60 technology templates, including Node.js, Python, Laravel, Unity and Docker. Pick your stack, add optional custom rules, then copy the result or download it as a .gitignore file. It is made for developers who want a clean first commit.
A .gitignore file is a plain text file that tells Git which files and folders to leave out of version control. Each line is a pattern, and Git skips any untracked file that matches one. Typical targets are dependency folders, build output, logs, editor settings and files that hold passwords or API keys.
Keeping these files out of your repository makes commits smaller, reviews easier and clones faster. It also protects you from publishing secrets by accident.
* matches any characters inside a single file or folder name, so *.log ignores every log file.** matches across folders, so **/temp matches a temp folder at any depth./ at the end matches folders only, so build/ ignores a folder but not a file named build.# is a comment.! is an exception that makes a path visible again. When two patterns conflict, the later line wins.You can build a complete file in under a minute by choosing templates, setting a few optional rules and copying the output. Here are the steps.
backups/ or *.bak.Each checkbox appends a group of common patterns to your file, so you do not have to remember them. Two are on by default and four are off.
| Option | Default | What it covers |
|---|---|---|
| Always block .env & secrets | On | Environment and secret files |
| Add macOS + Windows + Linux defaults | On | System clutter like .DS_Store and Thumbs.db |
| Add VS Code + JetBrains | Off | Editor and IDE folders |
| Block *.log / *.tmp / *.bak | Off | Logs and temporary files |
| Block *.zip / *.tar.gz / *.rar | Off | Archive files |
| Block coverage/ test artifacts | Off | Test coverage output |
Suppose you are starting a React front end with a Node.js back end on a Mac, using VS Code. You search for and click Node.js and React. In the advanced section you type Node and React app as the header, add backups/ to the ignore box, tick Add VS Code + JetBrains and enter .env.example in the force-include box.
After you click Generate .gitignore, the output starts with your header comment. Below it you get one labeled section per template, with entries such as node_modules/, dist/ and build/, followed by the operating system, editor and secrets groups and your own rules. The line counter above the output shows the total length.
Here is what that means in practice. The node_modules/ folder can hold thousands of files, and npm install rebuilds it, so it never belongs in Git. Your real .env stays private, while .env.example is force-included so teammates can see which variables the app needs.
A good generated file is short, grouped by technology and free of patterns that hide source code. Scan it once before you commit.
lib/ or public/ because those are build targets in certain stacks. If yours holds real code, add a force-include line for it.*.log or a block option caught it, then add that file to Force INCLUDE.Each line you add becomes an exception that starts with !, and the tool also reopens the parent folders so the exception can take effect. Git documents that you cannot re-include a file if one of its parent folders is excluded, which is why this matters. The side effect is that sibling files in those folders may become visible too, so read the output and check git status afterward.
Anyone who creates a repository benefits, because the first commit is where junk files usually slip in. These are common situations.
wp-config.php, uploads and cache folders so credentials and media stay out of the repo. If the site runs on Apache, an .htaccess redirect generator helps with the server side.Most .gitignore problems come from timing and placement, not from the patterns themselves. Use the points below to avoid them.
Git only ignores files it is not already tracking. Add the .gitignore first, then run git add ., so build folders and secrets never enter the history.
git rm --cached filename (add -r for a folder), commit, and the pattern will apply from then on..gitignore, not .gitignore.txt. Windows Explorer can hide extensions, so check the name in your editor./build, matches only at the root, while build/ matches at any depth.git check-ignore -v path/to/file to see which line decides the outcome.Use Download .gitignore and move the file into your project folder. Alternatively, create a new file named .gitignore in the root of your folder in VS Code or Visual Studio, paste the copied text and save.
Adding a pattern later does not erase history. If an .env file or key was already pushed, rotate that credential, because removing the file from the latest commit does not remove it from earlier ones.
Add a pattern whenever a tool starts producing new output, and commit .gitignore changes like any other code. The same habit applies to other config files you generate, such as CORS headers or a cron schedule.
The generator produces a solid starting point, not a scan of your project. It does not read your repository, so it cannot know which folders hold your real code. It also cannot untrack files Git already follows.
Templates are broad on purpose. A few ignore dependency lock or resolved-version files, such as the Swift and Xcode template with Package.resolved. Whether you commit those depends on your team, so decide deliberately. For anything unusual in your build, add your own lines in the advanced rules.
Build your file now with the generator above: choose your technologies, add any custom rules, then copy or download the result. When you need more utilities for your workflow, browse the full web developer tools collection.
Your report has been submitted. We will look into this issue.
A VPN changes your network exit. It does not guarantee anonymity.
Themes, plugins, code, video, audio, graphics & more from 90,000+ authors.
Web Development
Design & Media
Unlimited Access
Explore Envato Market