gpt4 book ai didi

git - 特别是在 git 推送到 Microsoft Azure 时出现 HTTP 413 错误

转载 作者:行者123 更新时间:2023-12-03 07:01:01 24 4
gpt4 key购买 nike

我在 Microsoft 论坛上问过这个问题,答案是我应该在另一个 Microsoft 论坛上问这个问题。那个论坛说我应该问自动化MS的事情或者来这里。简而言之,我不指望 MS 能帮助我解决这个问题。无论如何...

我正在将一些存储库从 Mercurial 迁移到 Git(使用 fast-export )。实际的过渡很好:历史完整无损,分支都在那里。

但是,我无法将其中一些新存储库推送到 MS Azure。我将在这里介绍最大的(也是最关键的)一个。它给出了以下错误。

$ git push -u origin --all
Enumerating objects: 138051, done.
Counting objects: 100% (138051/138051), done.
Delta compression using up to 12 threads
Compressing objects: 100% (43406/43406), done.
Writing objects: 100% (138051/138051), 202.73 MiB | 76.12 MiB/s, done.
Total 138051 (delta 94104), reused 137561 (delta 93696), pack-reused 0
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date

存储库刚刚超过 1 GB,其中大部分是包文件。为了避免大文件阻碍我推送,我使用 git repack 并将其分成 10 个 ~100MB 的文件。我没有在 Azure 上设置最大推送大小,并且此存储库中没有单个文件超过 100 MB。

我在几个网站上阅读了大量帖子,但他们的建议没有帮助。我的配置文件设置如下。 (我们的主要分支称为“生产”。)

[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignoreCase = false
[branch "Production"]
remote = origin
merge = refs/heads/Production
[http]
postBuffer = 2147483648
[remote "origin"]
url = ********
fetch = +refs/heads/*:refs/remotes/origin/*

即使我将包文件保留为单个 1GB 文件,我也可以毫无问题地推送到 GitHub。我还可以将存储库从 GitHub 导入到 Azure(仍然使用 1 GB 包文件),但我的老板想知道是否有办法消除该中间步骤。

我运行的是 Windows 11,并且尝试从命令行、PowerShell、Git Bash 和 Git 扩展进行推送,所有结果都相同。我什至尝试从 Windows 11 的 Linux VM 进行推送,但没有成功。

如果我做错了什么,我很想知道它是什么以及如何正确做。

最佳答案

一位同事建议通过 SSH 而不是 HTTPS 进行推送,效果很好!希望遇到同样问题的其他人也能从这个解决方案中受益。

关于git - 特别是在 git 推送到 Microsoft Azure 时出现 HTTP 413 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72366888/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com