0

我有一个 EC2 ubuntu 实例。我将一个示例节点项目克隆到其中,创建了一个 heroku 项目,(似乎成功地)添加了 SSH 密钥,但是当我尝试从我的实例中添加 heroku 作为远程时,我收到了这个错误:

ubuntu@ip-172-31-25-etc:/home/node-js-sample$ git remote -v
origin  https://github.com/heroku/node-js-sample.git (fetch)
origin  https://github.com/heroku/node-js-sample.git (push)
ubuntu@ip-172-31-25-etc:/home/node-js-sample$ git remote add heroku git@heroku.com:pure-beyond-9756.git
error: could not lock config file .git/config: Permission denied

前面提到的 .git/config 包含以下内容:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://github.com/heroku/node-js-sample.git
[branch "master"]
remote = origin
merge = refs/heads/master

如果我跳到我的 heroku 仪表板,那里一切都很好。为什么我会收到此权限被拒绝错误,以及如何解决?谢谢!

4

1 回答 1

0

我假设你安装了 Heroku 工具带

wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

尝试使用工具带的命令添加 Heroku 的遥控器:

$ heroku git:remote -a pure-beyond-9756

见:https ://devcenter.heroku.com/articles/git

对于类似的权限被拒绝问题,请检查此主题:askubuntu 上的问题

于 2013-06-26T13:15:20.693 回答