Conversation
There was a problem hiding this comment.
Pull request overview
Adds an Astro .gitignore template to this repository so users/tools (e.g., npx gitignore) can generate ignore rules for Astro projects.
Changes:
- Introduces a new Astro gitignore template file with ignore rules largely sourced from
withastro/astro.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| benchmark/results/ | ||
| test-results/ | ||
| *.log | ||
| package-lock.json |
There was a problem hiding this comment.
Ignoring package-lock.json by default is risky for typical Astro apps because lockfiles are commonly committed to ensure reproducible installs in CI and across developers. Unless Astro explicitly recommends ignoring lockfiles for end-user projects, this line should be removed (or at least scoped to the monorepo use case rather than a generic template).
| package-lock.json |
| .eslintcache | ||
| .pnpm-store | ||
| .vscode-test/ | ||
| .claude |
There was a problem hiding this comment.
.claude isn’t a standard Astro-generated file/directory and doesn’t appear in any other template in this repo. Including tool-specific config like this in a general Astro template will surprise users and can hide intentionally committed configuration; it should be removed from the template.
| .claude |
| .claude | ||
|
|
||
| # do not commit .env files or any files that end with `.env` | ||
| *.env |
There was a problem hiding this comment.
*.env will ignore all env files, including commonly-committed examples like .env.example. Other templates in this repo typically add an allowlist exception (e.g., !.env.example) or use more targeted patterns. Consider aligning with that approach so projects can keep sample env files under version control.
| *.env | |
| *.env | |
| !.env.example |
| packages/**/e2e/**/fixtures/**/.astro/ | ||
| packages/**/e2e/**/fixtures/**/env.d.ts | ||
| examples/**/.astro/ | ||
| examples/**/env.d.ts |
There was a problem hiding this comment.
The packages/... and examples/... ignore patterns are tied to Astro’s monorepo layout and are unlikely to apply to typical Astro projects. In a generic Astro template, these broad paths can accidentally match legitimate user directories named packages/examples and hide tracked files. Recommend removing these repo-specific entries and keeping only project-generated artifacts (e.g., .astro/, dist/, logs).
| examples/**/env.d.ts |
| # want to share with others (see | ||
| # https://github.com/withastro/astro/pull/11759#discussion_r1721444711) | ||
| *.code-workspace | ||
| packages/astro/e2e/fixtures/cloudflare/.wrangler/deploy/config.json |
There was a problem hiding this comment.
This ignore rule targets an extremely specific file path inside Astro’s own e2e fixtures (packages/astro/e2e/fixtures/...) and doesn’t belong in a general-purpose Astro project template. Keeping such a specific path in a public template adds noise and can confuse consumers; please remove it.
| packages/astro/e2e/fixtures/cloudflare/.wrangler/deploy/config.json |
| @@ -0,0 +1,49 @@ | |||
| node_modules/ | |||
There was a problem hiding this comment.
This template file is named Astro without the .gitignore suffix, which is inconsistent with the rest of this repository’s templates (e.g., Nextjs.gitignore, Angular.gitignore). This likely prevents it from being discovered/used by template tooling and by GitHub’s template chooser. Rename the file to Astro.gitignore.
| /triage/ | ||
| /.compiler/ |
There was a problem hiding this comment.
These ignore rules appear to be specific to the withastro/astro monorepo (e.g., /triage/, /.compiler/) rather than files generated by typical Astro projects. Including repo-internal directories in a general-purpose Astro template can cause unrelated user folders to be ignored unintentionally; consider removing these entries from the template.
| /triage/ | |
| /.compiler/ |
| scripts/smoke/*-main/ | ||
| scripts/memory/project/src/pages/ | ||
| benchmark/projects/ | ||
| benchmark/results/ | ||
| test-results/ |
There was a problem hiding this comment.
These patterns (scripts/..., benchmark/..., test-results/) look specific to Astro’s own repository/test setup rather than a consumer Astro application. To keep this template broadly applicable (per repo README guidance on scope), drop repo-internal paths and keep only ignores that are commonly produced by Astro projects.
| scripts/smoke/*-main/ | |
| scripts/memory/project/src/pages/ | |
| benchmark/projects/ | |
| benchmark/results/ | |
| test-results/ |
Reasons for making this change
I wanted to use "npx gitignore" with my new Astro project. I then found out that there is no gitignore for Astro in this repo.
Links to documentation supporting these rule changes
I couldn't find any documentation showing the gitignore file. I used the gitignore file from the astro repo from withastro.
https://github.com/withastro/astro/blob/main/.gitignore
https://github.com/withastro/astro/
If this is a new template
Link to application or project’s homepage: https://astro.build/
Merge and Approval Steps