git push fails with a message like:
remote: error: File data/big-archive.zip is 142.00 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected.
The large file is already in a local commit that has not been pushed (or only exists on your machine).
Git stores full file blobs in history. GitHub rejects any blob over 100 MB. Even if you delete the file in a later commit, the earlier blob still blocks the push until it is removed from the commits you are sending.
Work only on commits that have not been pushed to a shared remote. If the bad commit is already on main and others use it, stop and use a branch + PR instead of rewriting shared history.
git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| awk '/^blob/ { print $3, $4 }' \
| sort -n \
| tail -20
Note the path of the large file (example: data/big-archive.zip).
If the large file was added in the most recent commit and that commit is only local:
git rm --cached data/big-archive.zip
echo "data/big-archive.zip" >> .gitignore
git add .gitignore
git commit --amend --no-edit
Interactive rebase onto the last good remote commit:
git fetch origin
git rebase -i origin/main
Mark the offending commit as edit, then:
git rm --cached data/big-archive.zip
echo "data/big-archive.zip" >> .gitignore
git add .gitignore
git commit --amend --no-edit
git rebase --continue
git push origin HEAD
Only if the team already uses LFS and the file must live in the repo:
git lfs install
git lfs track "*.zip"
git add .gitattributes
# re-add the file after tracking, then commit
git add data/big-archive.zip
git commit -m "Store large archive with Git LFS"
Prefer not putting multi‑hundred‑MB archives in Git at all — use object storage or a release asset instead.
.gitignore before the first commit.main on a shared branch to fix this.Sample tech note for the portfolio Notes → Tech stream. Replace with your real workflow write-ups when ready.