简体   繁体   中英

Push the project into Git Hub and can't

I'm trying to push my project into my repo in GitHub, All is going good until write

Git push origin main

it's take long time and after that it's Display this error:

Enumerating objects: 3739, done.
Counting objects: 100% (3739/3739), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2910/2910), done.
Writing objects: 100% (3738/3738), 52.08 MiB | 5.83 MiB/s, done.
Total 3738 (delta 1554), reused 0 (delta 0), pack-reused 0
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date

All commands I wrote:

git init

git add.

git commit -m "new changes"

git push origin main

Any one Knows what is the problem?

First of all, Generate ssh key, follow this article:

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

If it is not working, check your.network connection stability.

If there is no problem with.network connection try another solution. it may work:

---On Linux---

Execute the following in the command line before executing the Git command:

export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1

---On Windows---

Execute the following in the command line before executing the Git command:

set GIT_TRACE_PACKET=1
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1

In addition:

git config --global core.compression 0
git clone --depth 1 <repo_URI>
# cd to your newly created directory
git fetch --unshallow 
git pull --all

As kodybrown said:

---For PowerShell users---

$env:GIT_TRACE_PACKET=1
$env:GIT_TRACE=1
$env:GIT_CURL_VERBOSE=1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM