Vue .gitignore template
The Vue template ignores the bundler output directory and local environment files, and unusually includes a handful of operating system and editor rules directly.
At a glance
- Category
- Framework
- Patterns in this template
- 15 rules
- Directories ignored
- 2 of the 15 rules end in a slash, so they match directories only
- Also needs an OS template
- Partly. This template already carries .DS_Store and several editor patterns.
- Typical companions
- npm, Yarn or pnpm. A Windows or Linux template if your team is not all on macOS.
In detail
dist is the bundler output: the hashed JavaScript and CSS files plus the generated index page. It is derived entirely from tracked sources and it changes wholesale on any dependency bump, so it is the classic example of output that makes a repository history unreadable if committed.
The environment rules are .env.local and .env.*.local, which together cover the local override family for any mode name the project defines. The pattern is the same two tier convention used elsewhere in the frontend world: files without the .local suffix are shared and committed, files with it are yours alone.
*.local is a broader rule that catches any file ending in that suffix, not just environment files. It is worth being aware of, because a data fixture or a configuration file you name something.local will be silently ignored by a rule that looks like it only concerns environment variables.
This template is one of the few that mixes in rules from other categories. .DS_Store covers the metadata file the macOS file manager writes, and *.suo, *.ntvs*, *.njsproj and *.sln cover Visual Studio project files that appear when the project is opened in that editor. *.sw? catches editor swap files.
That mixing is convenient but it is also why you should still add an operating system template. The macOS case is covered here, but Windows thumbnail caches and Linux trash directories are not, and a mixed team will produce both. It is also worth noticing what is absent: node_modules is ignored, and the lockfile beside it is not, which is exactly the right way round for a project that wants reproducible installs.
Examples
node_modules/
dist/
.env.local
.env.*.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
*.local
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?15 lines exactly as the tool writes them, before any common additions you tick.
Things that catch people out
- *.local matches any file with that suffix, not only environment files. Naming a fixture data.local means it never gets committed and nobody notices until CI fails.
- The template covers macOS but not Windows or Linux, so a mixed team still needs an operating system template on top.
- *.sln is ignored, which is right for a generated solution file but wrong if the repository deliberately ships one for a companion project.
Try it: .gitignore Generator
Pick one or more templates, tick the common additions you want, and copy or download the combined .gitignore.
.gitignore Generator
LOCAL · Browser-OnlyGenerate comprehensive .gitignore files by combining templates for languages, frameworks, IDEs, and operating systems
Language
Framework
IDE
OS
Build Tool
Infrastructure
Common Additions
Preview
Select templates or common additions to generate a .gitignore file.
Related .gitignore templates
All .gitignore templates →React .gitignore template
A short template built around one idea: the .env.local family is per developer and never committed, while the plain .env is shared and usually should be.
Next.js .gitignore template
What the Next.js template ignores: the build cache, the static export folder, deployment state, and one wildcard that covers every local environment file.
macOS .gitignore template
Where .DS_Store actually comes from, why it appears in folders nobody edited, and what the rest of the macOS template covers on network and removable volumes.
Angular .gitignore template
The Angular template ignores compiled output, the type checker's intermediate folder, the local build cache, and logs older test tooling leaves behind.
Django .gitignore template
The Django template adds four framework rules to the usual Python ones: local settings, the SQLite database, uploaded media and collected static files.
Flask .gitignore template
The Flask template adds the instance folder to the usual Python rules, which is the framework's designated place for configuration that must not be committed.
Tools for this
- .gitignore Generator Generate .gitignore files for any project - 50+ templates for languages, frameworks, IDEs, and OS
- .env Editor & Validator Edit and validate .env files online - detect duplicates, mask secrets, generate .env.example