git pull突然挂了

标签 git ubuntu unix ssh git-pull

我不知道为什么最近我的 git pull 开始挂起

我已经尝试过了

git fsck && git gc --prune=now

enter image description here

<小时/>

更新

网络防火墙

这是我在 Digital Ocean 的网络防火墙中设置的

enter image description here

我无法访问互联网,也无法 ping google

enter image description here

我无法从 bitbucket 执行 ping 或 ssh

enter image description here

<小时/>

更新2

└── iptables -S                                                                                                                 
-P INPUT ACCEPT                                                                                                                   
-P FORWARD ACCEPT                                                                                                                 
-P OUTPUT ACCEPT                                                                                                                  


                                                                                      
└── ufw status                                                                                                                    
Status: inactive 
<小时/>

更新3

我什至尝试在网络级别和服务器级别内部完全禁用防火墙。我看起来仍然相同结果

<小时/>

更新 4

└── GIT_TRACE=1 GIT_CURL_VERBOSE=1 git pull

11:07:35.834628 git.c:344               trace: built-in: git pull                                                                                     
11:07:35.838802 run-command.c:646       trace: run_command: git fetch --update-head-ok                                                                
11:07:35.858628 git.c:344               trace: built-in: git fetch --update-head-ok                                                                   
11:07:35.864635 run-command.c:646       trace: run_command: unset GIT_DIR GIT_PREFIX; ssh git@bitbucket.org 'git-upload-pack '\''jdoe/project.git'\'''  
<小时/>

更新5

└── GIT_SSH_COMMAND="ssh -vvv"GIT_TRACE=1 git pull

12:09:17.835895 git.c:344               trace: built-in: git pull                                                                                     
12:09:17.836775 run-command.c:646       trace: run_command: git fetch --update-head-ok                                                                
12:09:17.838743 git.c:344               trace: built-in: git fetch --update-head-ok                                                                   
12:09:17.839407 run-command.c:646       trace: run_command: unset GIT_DIR GIT_PREFIX; 'ssh -vvv' git@bitbucket.org 'git-upload-pack '\''jdoe/project.git'\'''                                                                                                                                        
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017                                                                                           
debug1: Reading configuration data /etc/ssh/ssh_config                                                                                                
debug1: /etc/ssh/ssh_config line 19: Applying options for *                                                                                           
debug2: resolving "bitbucket.org" port 8200                                                                                                           
debug2: ssh_connect_direct: needpriv 0                                                                                                                
debug1: Connecting to bitbucket.org [18.205.93.1] port 8200.   
<小时/>

更新 6

vi/etc/ssh/sshd_config

Port 8200                                                                                                                                               
Protocol 2                                                                                                                                              
HostKey /etc/ssh/ssh_host_rsa_key                                                                                                                       
HostKey /etc/ssh/ssh_host_dsa_key                                                                                                                       
HostKey /etc/ssh/ssh_host_ecdsa_key                                                                                                                     
HostKey /etc/ssh/ssh_host_ed25519_key                                                                                                                   
UsePrivilegeSeparation yes                                                                                                                              
KeyRegenerationInterval 3600                                                                                                                            
ServerKeyBits 1024                                                                                                                                      
SyslogFacility AUTH                                                                                                                                     
LogLevel INFO                                                                                                                                           
PermitRootLogin yes                                                                                                                                     
StrictModes yes                                                                                                                                         
RSAAuthentication yes                                                                                                                                   
PubkeyAuthentication yes                                                                                                                                
IgnoreRhosts yes                                                                                                                                        
RhostsRSAAuthentication no                                                                                                                              
HostbasedAuthentication no                                                                                                                              
PermitEmptyPasswords no                                                                                                                                 
ChallengeResponseAuthentication no                                                                                                                      
PasswordAuthentication no                                                                                                                               
X11Forwarding yes                                                                                                                                       
X11DisplayOffset 10                                                                                                                                     
PrintMotd no                                                                                                                                            
PrintLastLog yes                                                                                                                                        
TCPKeepAlive yes                                                                                                                                        
AcceptEnv LANG LC_*                                                                                                                                     
Subsystem sftp /usr/lib/openssh/sftp-server                                                                                                             
UsePAM yes  
<小时/>

我还需要检查什么?

最佳答案

除了跟踪和协议(protocol)(在您的情况下为 SSH)之外,还要检查您从中提取数据的远程托管服务器的状态。

例如,GitHub had an incident yesterday ,这可以解释克隆/pull 请求中的一些延迟。

这个DigitalOcean thread提及:

I had to add outbound rule for SSH and DNS UDP

正如 our discussion 中提到的,问题是/etc/ssh/ssh_config

Do you know why I kept trying to connect to BitBucket at port 8200 instead of 22 ? Where is the settings for that ?

这是第一行:端口 8080 更改为 22

关于git pull突然挂了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60791371/

相关文章:

c - 如何动态创建 Unix 管道?

影响 master 的分支上的 Git Push -f

python - 如何在 GIT 中处理 python 模块

javascript - 从命令行打开 Chrome/Chromium 并将 javascript 操作发送到 chrome/chromium 控制台

linux - 依赖性问题 - 未配置

c++ - UNIX 系统调用的排序规范

linux - 如何仅还原特定文件中的特定行?

git - 使用撤销的 GPG key 处理签名的 git 提交

java - 如何调试编译gwt源代码: "An unexpected error has been detected by Java Runtime Environment"?时的错误

perl - 为什么这些时间戳与 Perl Time::HiRes 不一致?