2016年9月16日 星期五

how to use git ssh to clone a repository (permission deny )

this message us useful

when using the ssh to clone a repository, it first need to establish the rsa key pair ,that is you need to generate a key public and add this key on the remote website,
as you can see in the following instruction  "rnu  cd ~/.ssh && ssh-keygen"

and add this key on website,
after  when git clone ssh  it can verify your identification, resolving the permission deny problem

another easy to solve is use https to git clone a repository



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.
  • First you'll want to 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 OS X run: cat id_rsa.pub | pbcopy
    • On Linux run: cat id_rsa.pub | xclip
    • On Windows (via Cygwin/Git Bash) run: cat id_rsa.pub | clip
  • Add your key to your account via the website.
  • Finally setup your .gitconfig.
    • 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.





the above message copies from

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

沒有留言:

張貼留言