在公司防火墙后运行Gatsby cli

在公司防火墙后运行Gatsby cli,gatsby,Gatsby,我无法使用gatsby cli克隆gatsby-starter-default.git,因为它使用的是被防火墙规则阻止的“git”url 我也尝试将以下内容添加到git配置中,但仍然没有什么乐趣 git config--全局url。“https://”。而不是git:// 下面是输出 gatsby new gatsby-site 2017-10-24T20:57:34-0500 <log> init-starter.js:107 (clone) Cloning git repo gi

我无法使用gatsby cli克隆gatsby-starter-default.git,因为它使用的是被防火墙规则阻止的“git”url

我也尝试将以下内容添加到git配置中,但仍然没有什么乐趣

git config--全局url。“https://”。而不是git://

下面是输出

gatsby new gatsby-site
2017-10-24T20:57:34-0500 <log> init-starter.js:107 (clone) Cloning git repo git://github.com/gatsbyjs/gatsby-starter-default.git to gatsby-site...
2017-10-24T21:00:04-0500 <error> new.js:12 () Error: Git clone error: Cloning into 'gatsby-site'...
fatal: unable to access 'https://github.com/gatsbyjs/gatsby-starter-default.git/': Failed to connect to github.com port 443: Operation timed out
gatsby新的gatsby站点
2017-10-24T20:57:34-0500 init starter.js:107(克隆)克隆git repogit://github.com/gatsbyjs/gatsby-starter-default.git 到盖茨比网站。。。
2017-10-24T21:00:04-0500 new.js:12()错误:Git克隆错误:克隆到“盖茨比网站”。。。
致命:无法访问'https://github.com/gatsbyjs/gatsby-starter-default.git/“:无法连接到github.com端口443:操作超时
是否有办法强制cli使用https://而不是git://

是。根据文档,您可以将
URL
设置为参数:

gatsby new gatsby-site http://github.com/gatsbyjs/gatsby-starter-default.git

直接克隆启动器即可

gatsby new
是一种方便,但不是必需的。它所做的是:

  • 浅层复制回购协议
  • 删除.git目录(这样您就不会负担初学者的git历史记录)
  • 运行npm或纱线安装

  • 谢谢你,德里克。我尝试了这个,但它似乎仍然试图使用GitURL来提取代码<代码>盖茨比新盖茨比网站https://github.com/gatsbyjs/gatsby-starter-default.git 2017-10-25T19:09:02-0500 init starter.js:107(克隆)克隆git repogit://github.com/gatsbyjs/gatsby-starter-default.git 到盖茨比网站。。。2017-10-25T19:11:34-0500 new.js:12()错误:Git克隆错误:克隆到“盖茨比网站”。。。致命:无法访问'https://github.com/gatsbyjs/gatsby-starter-default.git/“:无法连接到github.com端口443:操作超时