Skip to content

Ignore .gitattributes when copying repo files to a bucket#4082

Merged
Wauplin merged 1 commit intomainfrom
ignore-gitattributes-copy-files
Apr 10, 2026
Merged

Ignore .gitattributes when copying repo files to a bucket#4082
Wauplin merged 1 commit intomainfrom
ignore-gitattributes-copy-files

Conversation

@Wauplin
Copy link
Copy Markdown
Contributor

@Wauplin Wauplin commented Apr 10, 2026

Context: https://huggingface.slack.com/archives/C0A4RUVRLSC/p1775725585026259 (internal private thread)
.gitattributes files are specific to git-based repos. Let's not copy them to buckets.

🤖 Generated with Claude Code


Note

Low Risk
Low risk: small behavioral change limited to copy_files when the source is a repo, with no auth/data model changes. Main risk is unexpected omission if a user intentionally wanted .gitattributes copied to a bucket.

Overview
Updates HfApi.copy_files to exclude .gitattributes when the source is a repository, both for single-file copies (early return) and recursive folder copies (filter during tree walk).

Documents this repo-to-bucket filtering in the copy_files docstring; bucket-to-bucket copy behavior is unchanged.

Reviewed by Cursor Bugbot for commit ee2f122. Bugbot is set up for automated code reviews on this repo. Configure here.

`.gitattributes` is git-specific metadata that is not relevant in a
bucket context. Skip it automatically in `copy_files` when the source
is a repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@bot-ci-comment
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Copy Markdown
Contributor Author

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

@Wauplin Wauplin merged commit 79348a7 into main Apr 10, 2026
19 of 21 checks passed
@Wauplin Wauplin deleted the ignore-gitattributes-copy-files branch April 10, 2026 14:20
@huggingface-hub-bot
Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.11.0 release.

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.

2 participants