.gitignoreとは
Gitの管理対象から除外するファイルやフォルダを指定するファイル。
Astroプロジェクト向け設定
node_modules/
dist/
.env
.env.local
.astro/
*.log
.DS_Store
.gitignoreが効かない時の対処法
git rm -r --cached ファイル名
git add .
git commit -m "remove from tracking"
テンプレートを使う
https://www.toptal.com/developers/gitignore で自動生成できる。
ハマったポイント
.envファイルには絶対に秘密のキーを書かない- すでにcommitしたファイルは
git rm --cachedで外す