最新消息:20210917 已从crifan.com换到crifan.org

【已解决】mac中git pull卡死永远不动

Mac crifan 6116浏览 0评论
折腾:
【未解决】git push出错:rejected error failed to push some refs to
期间,mac中git pull,结果卡死不动了。
git pull origin master
此处半天都没反应
结果另外终端中,git pull也卡死了:
重启电脑再说。
 git status
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)


nothing to commit, working tree clean
 xxx@xxx  ~/dev/xxx/crawler/appAutoCrawler/AppCrawler   master  git pull  
也是卡死。
 git --version
git version 2.20.1 (Apple Git-117)
mac中git卡死
mac git 卡死
mac git stuck
Git pull push 卡死解决办法_程序员的蜕变-CSDN博客
 git gc --prune=now
Enumerating objects: 114, done.
Counting objects: 100% (114/114), done.
Delta compression using up to 8 threads
Compressing objects: 100% (111/111), done.
Writing objects: 100% (114/114), done.

 git gc            
Enumerating objects: 114, done.
Counting objects: 100% (114/114), done.
Delta compression using up to 8 threads
Compressing objects: 100% (102/102), done.
Writing objects: 100% (114/114), done.
Total 114 (delta 9), reused 114 (delta 9)
结果git pull还是卡死
mac git  pull locking
git – github locks up mac terminal when using pull command – Stack Overflow
Git – fatal: Unable to create ‘/path/my_project/.git/index.lock’: File exists – Stack Overflow
 rm -f ./.git/index.lock
 xxx@xxx  ~/dev/xxx/crawler/appAutoCrawler/AppCrawler   master ●  git pull               
^C
问题依旧。
git bash – Why does git pull hang? – Stack Overflow
 git fsck && git gc --prune=now
Checking object directories: 100% (256/256), done.
Checking objects: 100% (114/114), done.
Enumerating objects: 114, done.
Counting objects: 100% (114/114), done.
Delta compression using up to 8 threads
Compressing objects: 100% (102/102), done.
Writing objects: 100% (114/114), done.
Total 114 (delta 9), reused 114 (delta 9)
version control – How to avoid getting locked out of your GIT repo / SSH? – Stack Overflow
Git and nasty “error: cannot lock existing info/refs fatal” – Stack Overflow
File Locking · git-lfs/git-lfs Wiki
Performing git operations reveals a git process lock · Issue #1493 · zeit/hyper
How to manage locked files and permissions of a git repo between windows and mac – Super User
mac git  pull hang forever
ssh – git clone hangs forever on github – Stack Overflow
加–verbose试试
 git pull --verbose                                
问题依旧。
ssh – Git fetch/pull/clone hangs on receiving objects – Stack Overflow
难道是:此处连接的是gitlab是属于公司的内网,但是此处网络是家里网络,无法连上gitlab,所以挂掉?
那也应该会报错才对啊,有些提示才对啊
去试了试git clone,现象一样:
 git clone http://xxx:12310/data/data_xxx/appcrawler.git
Cloning into 'appcrawler'…
始终卡死没输出。
Git fetch / pull seems to hang. (#3188) · Issues · GitLab.com / GitLab.com Support Tracker · GitLab
https://gitlab.com/gitlab-com/support-forum/issues/3188
加上
GIT_CURL_VERBOSE=1 GIT_TRACE=1
试试:
 GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone http://xxx:12310/data/data_xxx/appcrawler.git
09:57:05.640689 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/bin/git
09:57:05.644553 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/bin
09:57:05.648335 git.c:418               trace: built-in: git clone http://xxx:12310/data/data_xxx/appcrawler.git
Cloning into 'appcrawler'...
09:57:05.672084 run-command.c:643       trace: run_command: git-remote-http origin http://xxx:12310/data/data_xxx/appcrawler.git
09:57:05.711726 exec-cmd.c:139          trace: resolved executable path from Darwin stack: /Library/Developer/CommandLineTools/usr/libexec/git-core/git-remote-http
09:57:05.716350 exec-cmd.c:236          trace: resolved executable dir: /Library/Developer/CommandLineTools/usr/libexec/git-core
* Couldn't find host xxx in the .netrc file; using defaults
*   Trying 35.169.58.188...
* TCP_NODELAY set
看来就是这个原因了:
此处git仓库,git服务器,gitlab,是属于公司内网,此处网络不在公司局域网,无法解析域名,连不上
但是始终卡死,无任何输出,也没有提示,就很垃圾了。。
回到公司网络后,继续去试试,估计就可以有输出,可以连上了。
现在已回到公司,连上公司的WiFi,再去试试
就可以了,不会卡死了。
【总结】
此处git pull(或 git push等)其他操作,卡死,没反应
原因:git的仓库gitlab服务器,属于公司内网,此时在家,无法访问公司内容,导致git pull或push时,先去尝试连接gitlab服务器,但是连不上,就一直卡死
疑问:但是诡异的是,竟然也没有超时报错之类的东西,纯粹是永远卡死不动。有点奇怪。
解决办法:去公司后,能连上公司的内网,能连上内网的Gitlab后,再去git pull或push,就都正常了。

转载请注明:在路上 » 【已解决】mac中git pull卡死永远不动

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
85 queries in 0.902 seconds, using 20.16MB memory