Skip to content

Add details for user .gitignore configuration #6228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions docs/app/core-concepts/writing-and-organizing-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,15 @@ detail.

<strong>What files should I add to my '.gitignore file' ?</strong>

Cypress will create a
[`screenshotsFolder`](/app/references/configuration#Screenshots) and a
[`videosFolder`](/app/references/configuration#Videos) to store the
screenshots and videos taken during the testing of your application. Many users
will opt to add these folders to their `.gitignore` file. Additionally, if you
are storing sensitive environment variables in your
Cypress may create
[asset files](#Asset-Files) in a
[`downloadsFolder`](#Download-Files), a
[`screenshotsFolder`](#Screenshot-Files) or a
[`videosFolder`](#Video-Files) to store any downloads,
screenshots or videos created during the testing of your application.
Many users will opt to add these folders to their
[.gitignore](https://git-scm.com/docs/gitignore) file (see [below](#Asset-Files) for an example).
Additionally, if you are storing sensitive environment variables in your
[Cypress configuration](/app/references/configuration) or
[`cypress.env.json`](/app/references/environment-variables#Option-2-cypressenvjson),
these should also be ignored when you check into source control.
Expand Down Expand Up @@ -151,8 +154,16 @@ command and most often when you're stubbing
There are some folders that may be generated after a test run, containing assets
that were generated during the test run.

You may consider adding these folders to your `.gitignore` file to ignore
checking these files into source control.
You may consider adding these folders to your
[.gitignore](https://git-scm.com/docs/gitignore) file to prevent
checking files in these folders into source control, for example, using the default folder locations:

```text
# Cypress asset folders to exclude from source control
cypress/downloads/
cypress/screenshots/
cypress/videos/
```

#### Download Files

Expand Down