簡體   English   中英

把項目push到Git Hub里面不行

[英]Push the project into Git Hub and can't

我正在嘗試將我的項目推送到 GitHub 中的回購協議中,在寫入之前一切正常

Git push origin main

這需要很長時間,然后顯示此錯誤:

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

我寫的所有命令:

git 初始化

git 添加。

git commit -m “新變化”

git push origin main

任何人都知道是什么問題?

首先,生成ssh密鑰,按照這篇文章:

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

如果它不起作用,請檢查您的網絡連接穩定性。

如果網絡連接沒有問題,請嘗試其他解決方案。 它可能有效:

---On Linux---

在執行 Git 命令之前,在命令行中執行以下命令:

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

---On Windows---

在執行 Git 命令之前,在命令行中執行以下命令:

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

此外:

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

正如科迪布朗所說:

---For PowerShell users---

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM