Linux 私人 Git 存储库 - 在拉动时冻结
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7131081/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Private Git repo - freezes at pulling
提问by Robik
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:
我只是在我的 linux 服务器上设置了 git 并配置了 SSH - 我想创建私人存储库与我的朋友一起工作。当我拉取或克隆该 repo 时,一切正常(LAN),但是当我的朋友尝试拉取或克隆它(通过 Internet)时,git 挂在:
remote: Compressing objects: x
where x is always lower than 17%.
其中 x 始终低于 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
.
PS:我没有使用 gitosis,我用: 初始化了那个远程仓库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.
但是,当我的朋友获得带有来源的 ZIP 并推送它时,一切正常。所以他可以推。我添加了一个空文件并推送了它,他成功下载(拉)了它。
回答by Gerry
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.
如果您的服务器是安全的,则更新您的问题以包含该命令的输出。如果它不安全,则将 IP 和其他识别详细信息更改为虚假 IP 和虚假详细信息,但尽量不要更改任何其他内容,因为您最终可能会提供误导性信息。
Edit based on update:
根据更新编辑:
The url should start with "ssh://" not "ssh/". Although I'm about to go double check that.
url 应该以“ssh://”而不是“ssh/”开头。虽然我要去仔细检查一下。
回答by James Baker
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.
在进入以太网适配器设置并将巨型数据包大小从 1514 字节更改为 9014 字节之前,我遇到了同样的问题。
回答by Eddie
If Git push/pull freeze using a config that previously worked, try restarting the computer.
如果使用以前工作的配置 Git 推/拉冻结,请尝试重新启动计算机。
It sounds strange yet I have experienced this on Windows and Linux.
这听起来很奇怪,但我在 Windows 和 Linux 上都遇到过这种情况。