私人 Git 存储库 - 拉取时冻结

发布于 2024-11-30 10:57:15 字数 930 浏览 1 评论 0原文

我只是在我的 Linux 服务器上设置了 git 并配置了 SSH - 我想创建私人存储库来与我的朋友一起工作。当我拉或克隆该存储库时,一切正常(局域网),但是当我的朋友尝试拉或克隆它(通过互联网)时, git 挂在:

remote: Compressing objects: x

其中 x 始终低于 17%。

有什么问题或者如何修复它?

PS:我没有使用 gitosis,我使用以下命令初始化了远程存储库:git --bare init

提前致谢。

更新:

结果命令:

$ cat .git/config

[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = ssh://git@server:port/~/repo_name.git
fetch = +refs/heads/*:refs/remotes/origin/*

 

$ git fetch -v
Enter passphare for key '/c/Users/dev/.ssh/id_rsa':
remote: Counting objects: 76, done.
remote: Compressing objects: 21% (12/55)

然而,当我的朋友获得带有源代码的 ZIP 并推送它时,一切正常。 所以他能够推动。我添加了一个空文件并推送它,他成功下载(拉取)了它。

I just setup git on my linux server and configured SSH - I want to create private repository to work with my friends. When I'm pulling or cloning that repo everything works fine (LAN), but when my friend tries pull or clone it (over Internet),
git hangs at:

remote: Compressing objects: x

where x is always lower than 17%.

What's wrong with it or how could I fix it?

PS: I not using gitosis, I initialized that remote repo with: git --bare init.

Thanks in advance.

Update:

The results commands:

$ cat .git/config

[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = ssh://git@server:port/~/repo_name.git
fetch = +refs/heads/*:refs/remotes/origin/*

 

$ git fetch -v
Enter passphare for key '/c/Users/dev/.ssh/id_rsa':
remote: Counting objects: 76, done.
remote: Compressing objects: 21% (12/55)

However, when my friend got ZIP with sources and he pushed it, everything worked fine.
So he is able to push. I added an empty file and pushed it, he successfully downloaded (pulled) it.

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

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

发布评论

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

评论(3

瑾夏年华 2024-12-07 10:57:15

让你的朋友尝试一下:

git fetch -v

如果这没有给你答案,那么让他这样做:

cat .git/config

如果你的服务器是安全的,那么更新你的问题以包括该命令的输出。如果不安全,则将 IP 和其他识别详细信息更改为假 IP 和假详细信息,但尽量不要更改其他任何内容,因为您最终可能会提供误导性信息。


根据更新进行编辑:

网址应以“ssh://”而不是“ssh/”开头。虽然我要去仔细检查一下。

Get your friend to try:

git fetch -v

If that doesn't give you the answer then get him to do this:

cat .git/config

If your server is secure then update your question to include the output of that command. If it's not secure then change the IP and other identifying details to a fake IP and fake details, but try not to alter anything else as you may end up providing misleading info.


Edit based on update:

The url should start with "ssh://" not "ssh/". Although I'm about to go double check that.

小矜持 2024-12-07 10:57:15

如果 Git 使用之前有效的配置推/拉冻结,请尝试重新启动计算机。

听起来很奇怪,但我在 Windows 和 Linux 上都经历过这种情况。

If Git push/pull freeze using a config that previously worked, try restarting the computer.

It sounds strange yet I have experienced this on Windows and Linux.

且行且努力 2024-12-07 10:57:15

我遇到了同样的问题,直到我进入以太网适配器设置并将巨型数据包大小从 1514 字节更改为 9014 字节。

I had the same problem until I went into my Ethernet adapter settings and changed the Jumbo Packet size from 1514 bytes to 9014 bytes.

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