Git - Permission denied (publickey)


http://stackoverflow.com/questions/2643502/git-permission-denied-publickey



I'm on Mac Snow Leopard and I just installed git.

I just tried

git clone git@thechaw.com:cakebook.git

but that gives me this error.

Initialized empty Git repository in `/Users/username/Documents/cakebook/.git/`
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

What am I missing?
I've also tried doing ssh-keygen with no passphase but still same error.

-----------------------------------------------------------------------------------------------------------------------

This info is for working on theChaw but can be applied to all other git repositories which support ssh pubkey authentications. (see gitolite, gitlab or github for example)

first start by setting up your own public/private key pair set. This can use either dsa or rsa, so basically any key you setup will work. On most systems you can use ssh-keygen.

  • But first you want to make sure you cd into your .ssh directory. Open up the terminal and run:

    cd ~/.ssh && ssh-keygen

  • next you need to copy this to your clipboard.
    • On OSX run: cat id_rsa.pub | pbcopy
    • On Linux run: cat id_rsa.pub | xclip
  • Add your key to your account via the website.
  • finally setup your git config
    • git config --global user.name "bob"
    • git config --global user.email bob@... (don't forget to restart your command line to make sure the config is reloaded)
Thats it you should be good to clone and checkout.

Further information can be found on https://help.github.com/articles/generating-ssh-keys (thx to @Lee Whitney)


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值