Перейти к основному содержимому

2026-05-20 · Чтение 1 мин

gitignore templates для new repositories

Start с stack-specific template вместо wholesale copy старого repo.

gitgitignoredevtools

Основные выводы

  • Pick template под primary language/runtime, затем append local paths.
  • Secrets out of git — .env в gitignore даже если parse env files в CI.

Choosing base template

Node templates cover node_modules, build output; Python — virtualenvs, __pycache__.

Regenerate при new language в monorepo — не hand-edit hundreds of lines без review.

Часто задаваемые вопросы

Commit .env.example?

Да — example без secrets helps onboarding; ignore real .env.

Merge two templates?

Generate one base, paste second stack unique lines, dedupe before commit.