Git i DevOps

Generador de .gitignore en línia

Selecciona les teves tecnologies i genera un fitxer .gitignore net i combinat.

HostingerHosting ràpid per a la teva webAllotjament, domini i SSL en un sol lloc.Veure oferta ↗HostingerLlança la teva web avuiHosting fiable per a projectes nous i webs en creixement.Veure oferta ↗
Preconfiguracions

Seleccionats

Afegir un fitxer a .gitignore no deixa de seguir-lo si Git ja el controla.

.gitignore guide

What is a .gitignore file?

A .gitignore file tells Git which files and directories should not be considered untracked files for addition to a repository. It is useful for dependencies, caches, logs and local configuration.

.gitignore syntax

Patterns such as *.log, /vendor/, /build/ and !important.log ignore extensions, directories and exceptions using Git syntax.

Should I ignore .env?

.env files commonly contain secrets or local configuration and should not be committed. Keep a .env.example without real credentials as a template.

Already tracked files

.gitignore mainly affects untracked files. It does not automatically remove files Git is already tracking from the index.

Frequently asked questions

Questions about .gitignore

How do I create a .gitignore file?

Select the templates you need, review the result and download it with the name .gitignore.

What should go in .gitignore?

Include dependencies, temporary files, logs, caches and local configuration that should not be committed.

How do I ignore a folder?

Add a rule such as /backups/ or /vendor/ to ignore a directory from the repository root.

How do I ignore all .log files?

Use the pattern *.log.

How do I exclude a file from a rule?

Prefix the path with !, for example !important.log after *.log.

Why does Git still show an ignored file?

It may already be tracked. .gitignore does not automatically remove it from the index.

Should I ignore vendor?

Usually yes when dependencies are installed with Composer; keep composer.lock according to your workflow.

Should I ignore node_modules?

Usually yes in Node.js projects, although this tool only generates text and never runs Node.

Should I commit .env to Git?

Not when it contains secrets. Use a .env.example without real credentials.

Can I combine multiple templates?

Yes. Select multiple templates; exact duplicate rules are shown only once.