gitPush.md
Command for safely pushing Unity WebGL builds and related changes with Git LFS.
.cursor/commands/gitPush.md
# Push Unity WebGL builds with Git LFS
1) Verify status/remotes
- `git status && git remote -v`
2) Ensure LFS tracking is configured
- `git lfs install`
- `.gitattributes` must include:
- `public/builds/**/Build/*.data(.br|.unityweb)`
- `public/builds/**/Build/*.wasm(.br|.unityweb)`
- `public/builds/**/Build/*.loader.js`
- `public/builds/**/Build/*.framework.js`
3) Keep only the latest Stable build
- Replace files in `public/builds/<game>/Stable/Build/`
- Do not keep older hashed builds; remove them before adding new ones
4) Stage and commit
- `git add -A`
- `git commit -m "Griddie Golf: update WebGL build with <summary>"`
5) First-time or after changing patterns
- `git add --renormalize .`
- `git commit -m "Apply Git LFS tracking"`
6) History migration to LFS (only as needed; destructive)
- `git lfs migrate import --include="public/builds/**/Build/*.wasm,public/builds/**/Build/*.wasm.br,public/builds/**/Build/*.wasm.unityweb,public/builds/**/Build/*.data,public/builds/**/Build/*.data.br,public/builds/**/Build/*.data.unityweb,public/builds/**/Build/*.loader.js,public/builds/**/Build/*.framework.js"`
- `git push --force-with-lease --all && git push --force-with-lease --tags`
7) Otherwise push normally
- `git push origin main`
8) Clean local storage (optional but recommended)
- `git lfs prune && git gc --prune=now --aggressive`
Notes:
- Vercel cache: `next.config.ts` sets `no-store` for `index.html` and `immutable` for hashed assets.