Skip to content

Exclude locally ignored files from build archives - #4123

Open
Nezz wants to merge 1 commit into
expo:mainfrom
Nezz:07-31-_eas-cli_exclude_locally_ignored_files_and_uncommitted_store_media_from_the_project_archive
Open

Exclude locally ignored files from build archives#4123
Nezz wants to merge 1 commit into
expo:mainfrom
Nezz:07-31-_eas-cli_exclude_locally_ignored_files_and_uncommitted_store_media_from_the_project_archive

Conversation

@Nezz

@Nezz Nezz commented Jul 31, 2026

Copy link
Copy Markdown

Why

Fixes #4122

How

GitClient now asks git which paths are ignored instead of grabbing git's ignore rules from .gitignore files only. That covers $GIT_DIR/info/exclude and core.excludesFile, and makes the copy consistent with isFileIgnoredAsync(), which already used git check-ignore. Projects with an .easignore keep the existing behaviour.

Test Plan

7 new tests, each failing on main: info/exclude, core.excludesFile, ignores inside a submodule, and tracked files matching a .gitignore rule. yarn test, yarn typecheck, yarn lint and yarn fmt:check are clean.

Reproduces with eas build:inspect -p ios -s archive -o /tmp/inspect on a blank project with a 100 MB directory listed in .git/info/exclude, where git status stays clean:

before  100M /tmp/inspect
after   132K /tmp/inspect

The working directory copy that adds uncommitted and untracked files to
the project archive filtered paths with a reimplementation of git's
ignore rules that only read .gitignore files. Paths excluded through
$GIT_DIR/info/exclude or core.excludesFile were therefore uploaded even
though git reports them as ignored, which is impossible to spot because
`git status` stays clean.

Ask git for the ignored paths instead, so archiving is consistent with
`isFileIgnoredAsync()`, which already uses `git check-ignore`. Tracked
files that match an ignore rule are now included too, since git never
reports them as ignored and the shallow clone is made with
`--no-checkout`.

Projects with an .easignore keep the existing behavior, where the file
replaces git's ignore rules entirely.
@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
packages/eas-cli/** @douglowder

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

@Nezz Nezz changed the title Exclude locally ignored files and store metadata from build archives Exclude locally ignored files from build archives Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eas build uploads include Claude worktrees

1 participant