user14954690
user14954690

Reputation:

Can't publish my files to remote repository

Uploading LFS objects: 100% (1201/1201), 2.6 GB | 9.1 MB/s, done.
Enumerating objects: 20004, done.
Counting objects: 100% (20004/20004), done.
Delta compression using up to 12 threads
Compressing objects: 100% (11626/11626), done.
remote: fatal: pack exceeds maximum allowed size        /s   
error: RPC failed; curl 55 Send failure: Connection was aborted
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (20004/20004), 4.78 GiB | 23.39 MiB/s, done.
Total 20004 (delta 11193), reused 17185 (delta 8374), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

I can't seem to publish my files to the remote repository. I have LFS enabled. How can I fix this?? enter image description here

Upvotes: 1

Views: 957

Answers (2)

user14954690
user14954690

Reputation:

Ok, so having found out that the error message was due to trying to push files that exceeded 2GB, I solved it by manually adding files incrementally.


How I did it:

On Git Bash

  1. git init
  2. git remote add origin (link)
  3. git lfs install
  4. git pull origin master
  5. The proceeding to create, add, commit, and push .gitattributes
  6. Track the LFS files: https://git-lfs.github.com/

Then go to Github Desktop (For some reason, adding, committing, and pushing LFS doesn't work in Git Bash. But simply initializing LFS in Github Desktop, without having done git lfs install in Git Bash, also doesn't work either.)

Has to be in this particular order for some reason.

  1. Add the repository and make sure to Initialize Git LFS
  2. Manually move files into the Local Repository folder and make sure it does not exceed 2GB.
  3. Add, commit, and push files

Upvotes: 0

bk2204
bk2204

Reputation: 76964

The problem you're seeing here has nothing to do with Git LFS. The problem is that the Git pack you're pushing to the remote is larger than 2 GB, which is the maximum limit that GitHub has to avoid denial-of-service problems and situations where people exceed maximum repository size limits.

You'd need to push your commits incrementally so that you end up with several smaller pushes. For example, if your branch is main, you could push 1000 commits at a time with this approach.

$ git rev-list --reverse main | \
  perl -ne 'print unless $i++ % 1000;' | \
  xargs -I{} git push origin {}:main

If you don't care for Perl. Ruby can do something similar.

You should then follow it up with the regular push you intended to do in the first place.

Upvotes: 1

Related Questions