.gitignore for Solidity

8 ignore rules for Solidity, ready to copy into your repository.

Contract-oriented programming language

The complete .gitignore for Solidity

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:28:16 UTC
# Technologies: Solidity

### Solidity ###
**/artifacts/
**/artifacts/**
deps/
states/
*.dbg.json
# TypeScript build info
*.tsbuildinfo
# Environment variables
.env
# Local environment variables
.env.local

What these Solidity rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

Remix compiler artifacts

Pattern What it ignores
**/artifacts/ Remix compiler artifacts
**/artifacts/** Remix compiler artifacts

Remix plugin state folders

Pattern What it ignores
deps/ Remix plugin state folders
states/ Remix plugin state folders

Debug info

Pattern What it ignores
*.dbg.json Debug info
*.tsbuildinfo TypeScript build info

Optional

Pattern What it ignores
.env Environment variables
.env.local Local environment variables

How to use this .gitignore for Solidity

  1. Copy the Solidity rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.

Other Language .gitignore templates

See every Language template