When you push a large commit with git

Asked 2 years ago, Updated 2 years ago, 45 views

I decided to git management of sites that were not git management until now, and
I tried to push to my gitlab, but
The following error occurred:

$git push origin master:master
Counting objects: 21810, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (21810/21810), done.
error: RPC failed; result=22, HTTP code=413B | 177.00 KiB/s   
fatal —The remote end hang up unexpectedly
Writing objects: 100% (21810/21810), 1.00 GiB | 21.07 MiB/s, done.
Total 21810 (delta 4024), reused 0 (delta 0)
fatal —The remote end hang up unexpectedly
Everything up-to-date

It has a capacity of about 1.2GB and
I think I got an error because I pushed it all at once, but
Is there any way to solve this?

git

2022-09-29 21:22

2 Answers

Why don't you remove the large file from the git management folder and then stage it again?

Also, since git is not good at handling binary files, I recommend using git-lfs if you have a large binary file.

https://git-lfs.github.com/


2022-09-29 21:22

If the transport is using HTTP and 413 is returned, that means that the data you are trying to send is still too large for the server.

I don't know the details of GitLab setup, but if you have nginx as your front-end server, you might want to improve it by configuring the following settings:

client_max_body_size2g;

Alternatively, it would be better to use a transport like SSH with no transmit data size limit.


2022-09-29 21:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.