2

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

我也尝试将以下内容添加到 git config 但仍然没有乐趣

git config --global url."https://".insteadOf 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

有没有办法强制 cli 使用 https:// 而不是 git://

4

2 回答 2

3

直接克隆启动器即可。

gatsby new是一种方便但不是必需的。它的作用是:

  1. 浅克隆一个 repo
  2. 删除 .git 目录(这样你就不会被 starter 的 git 历史所困扰)
  3. 运行 npm 或 yarn install
于 2017-10-26T00:52:23.370 回答
2

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

gatsby new gatsby-site http://github.com/gatsbyjs/gatsby-starter-default.git
于 2017-10-25T02:14:44.130 回答