請看操作指令:
C:\Users\macrotea>ping www.github.com
正在 Ping github.com [192.30.252.128] 具有 32 字节的数据:
来自 192.30.252.128 的回复: 字节=32 时间=260ms TTL=44
来自 192.30.252.128 的回复: 字节=32 时间=268ms TTL=44
来自 192.30.252.128 的回复: 字节=32 时间=257ms TTL=44
来自 192.30.252.128 的回复: 字节=32 时间=258ms TTL=44
192.30.252.128 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 257ms,最长 = 268ms,平均 = 260ms
C:\Users\macrotea>type c:\Users\macrotea\.gitconfig
[user]
name = macrotea
email = macrotea@qq.com
[alias]
ci = commit
co = checkout
st = status
br = branch
throw = reset --hard HEAD
throwh = reset --hard HEAD^
C:\Users\macrotea>git --version
git version 1.8.5.2.msysgit.0
C:\Users\macrotea>git ls-remote --tags --heads git://github.com/twbs/bootstrap.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.128]: errno=No error
C:\Users\macrotea>ping 192.30.252.128
正在 Ping 192.30.252.128 具有 32 字节的数据:
来自 192.30.252.128 的回复: 字节=32 时间=360ms TTL=44
来自 192.30.252.128 的回复: 字节=32 时间=360ms TTL=44
来自 192.30.252.128 的回复: 字节=32 时间=360ms TTL=44
来自 192.30.252.128 的回复: 字节=32 时间=354ms TTL=44
192.30.252.128 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 354ms,最长 = 360ms,平均 = 358ms
C:\Users\macrotea> why ? help ! thanks!
此問題來自於當使用Yeoman進行yo webapp時出錯:
npm http 304 https://registry.npmjs.org/grunt-autoprefixer
npm http 304 https://registry.npmjs.org/grunt-svgmin
bower bootstrap#~3.0.3
ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/twbs/bootstrap.git", exit code of #128
Additional error details:
fatal: unable to connect to github.com:
github.com[0: 192.30.252.129]: errno=No error
events.js:74
throw TypeError('Uncaught, unspecified "error" event.');
^
TypeError: Uncaught, unspecified "error" event.
at TypeError (<anonymous>)
at Appgenerator.EventEmitter.emit (events.js:74:15)
at done (C:\Users\macrotea\AppData\Roaming\npm\node_modules\generator-webapp\node_modules\yeoman-generator\lib\base.js:318:16)
at C:\Users\macrotea\AppData\Roaming\npm\node_modules\generator-webapp\node_modules\yeoman-generator\node_modules\async\lib\async.js:232:13
at C:\Users\macrotea\AppData\Roaming\npm\node_modules\generator-webapp\node_modules\yeoman-generator\node_modules\async\lib\async.js:113:21
at C:\Users\macrotea\AppData\Roaming\npm\node_modules\generator-webapp\node_modules\yeoman-generator\node_modules\async\lib\async.js:24:16
at C:\Users\macrotea\AppData\Roaming\npm\node_modules\generator-webapp\node_modules\yeoman-generator\node_modules\async\lib\async.js:229:17
at C:\Users\macrotea\AppData\Roaming\npm\node_modules\generator-webapp\node_modules\yeoman-generator\node_modules\async\lib\async.js:516:34
at Appgenerator.<anonymous> (C:\Users\macrotea\AppData\Roaming\npm\node_modules\generator-webapp\node_modules\yeoman-generator\lib\actions\install
.js:43:7)
at ChildProcess.EventEmitter.emit (events.js:117:20)
望君多指點!
某草草2017-04-24 16:02:52
應該是你的Github SSH設定問題
可以透過
$ ssh -vT git@github.com
來判斷是否配置成功 如果顯示
Hello xxxx! You ve successfully authenticated, but GitHub does not provide shell access.
表示成功
具體如何設定SSH 請看
https://help.github.com/articles/generating-ssh-keys
大家讲道理2017-04-24 16:02:52
應該是ssh網關的問題,github的ssh請求有時候會被封掉,不知道為什麼
用https替換ssh就可以了
這篇文章推薦你
/blog/leewind/1190000000691712