0

Hi i am facing issue with Git not able to push commit to remote.

I have the changes locally.

shammis-MacBook-Air:mlagents shammiseth$ git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch Projects/MLagents/mlagents/Project/Assets/ObstacleCourse/MamimoExport/Rifle 8-Way/‘Ch49_nonPBR.fbx'
WARNING: git-filter-branch has a glut of gotchas generating mangled history
     rewrites.  Hit Ctrl-C before proceeding to abort, then use an
     alternative filtering tool such as 'git filter-repo'
     (https://github.com/newren/git-filter-repo/) instead.  See the
     filter-branch manual page for more details; to squelch this warning,
     set FILTER_BRANCH_SQUELCH_WARNING=1.
Proceeding with filter-branch...

Rewrite 2b5367fec11dbaff653711b5bac96d5f6f39c3d3 (4/6) (1 seconds passed, remaining 0 predicted)    
WARNING: Ref 'refs/heads/master' is unchanged
shammis-MacBook-Air:mlagents shammiseth$ git push
Username for 'https://github.com':---------
Password for 'https://-----@github.com': 
Enumerating objects: 1049, done.
Counting objects: 100% (1049/1049), done.
Delta compression using up to 4 threads
Compressing objects: 100% (1023/1023), done.
Writing objects: 100% (1030/1030), 382.56 MiB | 3.16 MiB/s, done.
Total 1030 (delta 471), reused 0 (delta 0)
remote: Resolving deltas: 100% (471/471), completed with 12 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 78bb7797ed2695b18da092d0beec85d8af227589361e33ea11a21b534d6338cc
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Project/Assets/ObstacleCourse/MamimoExport/Rifle 8-Way/Ch49_nonPBR.fbx is 111.62 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/ssshammi/mlagents.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/ssshammi/mlagents.git'
shammis-MacBook-Air:mlagents shammiseth$ 

Please let me know how i can resolve this issue.

2 Answers2

0

What is probably the "real" answer is git-lfs like the error message suggests, which github does have support for, but it costs money when over 2GB. If your not in a position that that is available I found this post about how to work around the 100mb file size limit which some have to do with compression which would work well with .fbx files (becuase they are plain text and that compresses well)

Extra note that you left some information in the question that you might potentially want to remove (like your email)

ElasticEel
  • 31
  • 2
  • Hi i need to make changes to the previous commit and remove file from history, i deleted the file from recent commit. Can you let me know the commands some one is suggest git filter-repo --path --invert-paths – user1841144 Jul 23 '21 at 07:56
  • I tried this git filter-branch --index-filter "rm -rf --cached --ignore-unmatch Projects/MLagents/mlagents/Project/Assets/ObstacleCourse/MamimoExport/Rifle 8-Way/Ch49_nonPBR.fbx” HEAD It did not work – user1841144 Jul 23 '21 at 08:10
  • Look at using BFG https://rtyley.github.io/bfg-repo-cleaner/ – johnfo Jul 23 '21 at 08:35
0

There are two extra-suspicious items here. I've broken up the first very long line for posting purposes, so that one does not have to scroll left and right:

shammis-MacBook-Air:mlagents shammiseth$
git filter-branch --index-filter
'git rm -r --cached --ignore-unmatch
Projects/MLagents/mlagents/Project/Assets/
ObstacleCourse/MamimoExport/Rifle 8-Way/‘Ch49_nonPBR.fbx'

The git rm -r --cached --ignore-unmatched part is OK up to that point, but after that you have spelled out two separate file names:

Projects/MLAgents/mlagents/Project/Assets/ObstacleCourse/MamimoExport/Rifle

as the first file name, and:

8-Way/‘Ch49_nonPBR.fbx

as the second file name. Your filter-branch command will therefore remove these two files, but neither file exists in any commit.

The weird quote mark in 8-Way/‘Ch49_nonPBR.fbx may be a typo. In any case you definitely want to protect the space in the directory name Rifle 8-Way. That is, you probably want another layer of quotes:

'git rm -r --cached --ignore-unmatch "<insert file name here>"'

for instance. Check carefully whether that weird character is really supposed to be there, too.

The second suspicious item is this:

WARNING: Ref 'refs/heads/master' is unchanged

This tells us that your git rm -r --cached --ignore-unmatched command had no effect. No commits needed any changes, so no new-and-improved replacement commits were constructed, so that in the end, refs/heads/master referred to the same final commit you originally had.

You may be better-off using some other tool to fix your commits.

torek
  • 448,244
  • 59
  • 642
  • 775