【发布时间】:2017-07-13 11:11:30
【问题描述】:
我对 git 还很陌生,除了 Windows 之外很少使用任何东西进行编程。
我使用create-react-app 设置了一个React 应用程序,并使用gh-pages 将其部署到我的github.io 项目页面。我已经在本地机器上设置了一个 SSH 密钥并将其添加到我的 github SSH 密钥中。运行 ssh-agent 和 ssh-add 使得在 Git Bash 中的部署变得简单,无需输入用户名和密码。太好了。
但是,我正在使用Sublime Text 进行开发,并希望直接从编辑器中使用npm plugin 运行npm run deploy。我收到以下错误:
Cloning git@github.com:<username>/<repo>.git into node_modules\gh-pages\.cache
Cloning into 'node_modules\gh-pages\.cache'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
除非我猜错了,否则 git 似乎不知道自动使用 SSH 密钥,无论它是从哪里运行的。有没有办法配置这个?
【问题讨论】:
标签: git github ssh npm sublimetext3