Git LFS users: Have you gotten "error: failed to push some refs to..." error when pushing to GitHub?

I’m working on a game in Unity and installed Git LFS because some of the files I handle are pretty large. I have a proper .gitattributes setup and the local repo is properly linked to the remote repo on github. Whenever I try to push to the remote I keep getting this error:

! [remote rejected] master → master (pre-receive hook declined)

error: failed to push some refs to [repo name]

Here is the full push and all the messages that come up prior to the error

Uploading LFS objects: 100% (119/119), 133 KB | 0 B/s, done.
Enumerating objects: 5294, done.
Counting objects: 100% (5294/5294), done.
Delta compression using up to 12 threads
Compressing objects: 100% (5273/5273), done.
Writing objects: 100% (5293/5293), 977.45 MiB | 13.12 MiB/s, done.
Total 5293 (delta 2583), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2583/2583), done.
remote: warning: File [Long file name decided to ommit not sure if sensitive data] is 85.35 MB; this is larger than GitHub’s recommended maximum file size of 50.00 MB
remote: warning: File [Long file name decided to ommit not sure if sensitive data] is 85.35 MB; this is larger than GitHub’s recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: [long number not sure if sensitive info]
remote: error: See Managing large files - GitHub Docs for more information.
remote: error: File Assets/TerrainTexturesPackFree/TerrainTextures/GrassUV01.png is 153.13 MB; this exceeds GitHub’s file size limit of 100.00 MB
remote: error: File Assets/TerrainTexturesPackFree/TerrainTextures/GrassUV01_N.png is 145.23 MB; this exceeds GitHub’s file size limit of 100.00 MB
remote: error: File Assets/TerrainTexturesPackFree/TerrainTextures/GrassUV02.png is 149.48 MB; this exceeds GitHub’s file size limit of 100.00 MB
remote: error: File Assets/TerrainTexturesPackFree/TerrainTextures/GrassUV02_N.png is 113.87 MB; this exceeds GitHub’s file size limit of 100.00 MB
To [repo link]
! [remote rejected] master → master (pre-receive hook declined)
error: failed to push some refs to [repo link]

My guess is that the push is failing because of these large files sizes. The problem is that Git LFS does have a line in the .gitattributes to track .png files (all the ones with errors are png files) and by the looks of the very first line “uploading lfs objects” it is tracking large files but for whatever reason not .png which I know is accounted for, here is the line:

*.png filter=lfs diff=lfs merge=lfs -text

This is what I have done so far:

Completely removed Git and re initialized it along with re installing Git LFS.

Tried using the migrate command to move files in the normal commit into LFS

Deleted and recreated the repo in github and tried removing Git and re initialized it along with re installing Git LFS.

None of this seems to be working. Is anyone able to help out?

Did you see if there’s setup required for git lfs on github? I seem to remember having issues with LFS+Github, I’m not sure what solved it though.