.gitignore Generator

Build a .gitignore for your languages, frameworks, editors and operating systems, and test whether a path is ignored.

Runs in your browser. Nothing is uploaded.

Languages
Frameworks & tools
Editors
Operating systems
Always useful

    Is this path ignored?

    How to use the .gitignore Generator

    1. Tick the languages, frameworks, editors and operating systems used in your project. Type in the search box to find one quickly.
    2. Add any project-specific rules at the bottom, such as an uploads folder or a local config file.
    3. Copy the result or download it, and save it as .gitignore in the root of your repository.
    4. Type a path in Is this path ignored? to check which rule applies before you commit.

    Keep the right files out of git

    Every project produces files that don’t belong in version control: installed dependencies such as node_modules, build output, caches, logs, editor settings, operating system clutter like .DS_Store, and, most importantly, secrets in .env files. A .gitignore file lists patterns git should skip, so git status stays clean and nothing private gets pushed by accident.

    Build one in seconds

    Pick everything your project uses. Each choice adds a commented section, and rules that appear in more than one section are only written once, so combining Python, Java and Rust doesn’t give you three copies of build/. Templates cover common languages, popular frameworks such as Next.js, Vite, Astro, Django, Laravel and Unity, infrastructure tools such as Terraform, the main editors and all three desktop operating systems. Secrets is ticked by default: it ignores .env files while keeping an .env.example you can share.

    How the patterns work

    • A plain name like *.log matches in any folder.
    • A slash at the start or in the middle (/dist, docs/*.pdf) ties the pattern to the folder the .gitignore is in.
    • A slash at the end (build/) matches folders only.
    • ** matches any number of folders, as in **/temp or logs/**.
    • ! brings back something an earlier line ignored, and the last matching line wins.

    Test before you commit

    The path checker applies the same rules as git to any path you type and tells you whether it is ignored and which line decided. It also explains the most confusing case: a file inside an ignored folder can’t be brought back with !, because git never looks inside that folder.

    Made on your device

    Nothing is fetched or uploaded. Once your repository is set up, the README Generator and the License Generator help with the other files every project needs.

    Frequently asked questions

    Where does the .gitignore file go?

    Usually in the root folder of the repository, next to the .git folder. You can also add more .gitignore files in sub-folders; their rules apply to that folder and below.

    I added a file to .gitignore but git still tracks it. Why?

    .gitignore only affects files git isn’t tracking yet. Stop tracking the file with git rm --cached path/to/file and commit; it stays on your disk and is ignored from then on.

    What does the ! at the start of a line do?

    It re-includes something an earlier rule ignored, such as !.env.example after .env.*. It can’t re-include a file whose parent folder is ignored, because git doesn’t look inside ignored folders. The path checker tells you when that happens.

    Should I commit editor settings like .vscode or .idea?

    Usually not personal ones. The VS Code template ignores the folder but keeps shared files such as settings.json and extensions.json. For editor and OS files that only you create, a global ignore file (git config --global core.excludesFile) keeps them out of every project.

    Is anything uploaded?

    No. The file is assembled in your browser from templates built into the page.

    Tutorials