将项目推送到Git Hub 上不了

发布于 2025-01-09 18:53:36 字数 742 浏览 2 评论 0原文

我正在尝试将我的项目推送到 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 init

git add 。

git commit -m“新更改”

git push origin main

任何人都知道问题是什么?

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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

抽个烟儿 2025-01-16 18:53:36

首先,生成 ssh 密钥,请按照本文操作:

https://help.github.com/articles/generate-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

正如 kodybrown 所说:

---For PowerShell users---

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文