Improved git lfs instructions (#5707)

* Closes <https://github.com/emilk/egui/issues/5526>
* [x] I have followed the instructions in the PR template
This commit is contained in:
lucasmerlin 2025-03-04 11:38:46 +01:00 committed by GitHub
parent 26288d7dd7
commit e1f5d68995
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 26 additions and 7 deletions

View File

@ -35,13 +35,7 @@ You can test your code locally by running `./scripts/check.sh`.
There are snapshots test that might need to be updated. There are snapshots test that might need to be updated.
Run the tests with `UPDATE_SNAPSHOTS=true cargo test --workspace --all-features` to update all of them. Run the tests with `UPDATE_SNAPSHOTS=true cargo test --workspace --all-features` to update all of them.
For more info about the tests see [egui_kittest](./crates/egui_kittest/README.md). For more info about the tests see [egui_kittest](./crates/egui_kittest/README.md).
Snapshots and other big files are stored with git lfs. See [Working with lfs](#working-with-lfs) for more info.
We use [git-lfs](https://git-lfs.com/) to store big files in the repository.
Make sure you have it installed (running `git lfs ls-files` from the repository root should list some files).
Don't forget to run `git lfs install` after installing the git-lfs binary.
You need to add any .png images to `git lfs`.
If the CI complains about this, make sure you run `git add --renormalize .`.
If you see an `InvalidSignature` error when running snapshot tests, it's probably a problem related to git-lfs. If you see an `InvalidSignature` error when running snapshot tests, it's probably a problem related to git-lfs.
When you have something that works, open a draft PR. You may get some helpful feedback early! When you have something that works, open a draft PR. You may get some helpful feedback early!
@ -51,6 +45,31 @@ Don't worry about having many small commits in the PR - they will be squashed to
Please keep pull requests small and focused. The smaller it is, the more likely it is to get merged. Please keep pull requests small and focused. The smaller it is, the more likely it is to get merged.
## Working with git lfs
We use [git-lfs](https://git-lfs.com/) to store big files in the repository.
Make sure you have it installed (running `git lfs ls-files` from the repository root should list some files).
Don't forget to run `git lfs install` in this repo after installing the git-lfs binary.
You need to add any .png images to `git lfs` (see the .gitattributes file for rules and exclusions).
If the CI complains about lfs, try running `git add --renormalize .`.
Common git-lfs commands:
```bash
# Install git-lfs in the repo (installs git hooks)
git lfs install
# Move a file to git lfs
git lfs track "path/to/file/or/pattern" # OR manually edit .gitattributes
git add --renormalize . # Moves already added files to lfs (according to .gitattributes)
# Move a file from lfs to regular git
git lfs untrack "path/to/file/or/pattern" # OR manually edit .gitattributes
git add --renormalize . # Moves already added files to regular git (according to .gitattributes)
# Push to a contributor remote (see https://github.com/cli/cli/discussions/8794#discussioncomment-8695076)
git push --no-verify
```
## PR review ## PR review
Most PR reviews are done by me, Emil, but I very much appreciate any help I can get reviewing PRs! Most PR reviews are done by me, Emil, but I very much appreciate any help I can get reviewing PRs!