How to clone a repository from Github
2017-08-15 23:33
246 查看
Assume we are on a server, and we would like to clone a repsitory from Github.
Once we hit git clone git@github.com: repository name, an error was prompted:
To resolve this issue,
first, turn on the ssh-agent;
GitHub says, if it does not generate anything, you should either generate a new SSH key, or use an existing SSH key, and associate it with GitHub.
So, we go and check if there is already an SSH key available, we use the command:
We add our SSH private key to the ssh-agent, with command:
0) Copy the SSH key to your clipboard, which is
2) Click SSH and GPG keys,
3) Click New SSH key or Add SSH key,
4) Add description to the title;
5) Paste the key into the "Key" field.
We are done.
Reference: https://help.github.com/
Once we hit git clone git@github.com: repository name, an error was prompted:
Permission denied (publickey). fatal: Could not read from remote repository.Why is that? Because we haven't added our SSH key to the github account.
To resolve this issue,
first, turn on the ssh-agent;
eval "$(ssh-agent -s)"Then, verify that there is a private key generated and loaded into SSH, by command:
ssh-add -lHowever, we found nothing in there.
GitHub says, if it does not generate anything, you should either generate a new SSH key, or use an existing SSH key, and associate it with GitHub.
So, we go and check if there is already an SSH key available, we use the command:
ls -al ~/.sshThere it is. We found a key pair named id_rsa.pub and id_rsa.
We add our SSH private key to the ssh-agent, with command:
ssh-add ~/.ssh/id_rsaFinally, we reach the last step, that is, to add the SSH key to GitHub account.
0) Copy the SSH key to your clipboard, which is
~/.ssh/id_rsa.pub1) Go to Settings of your GitHub account,
2) Click SSH and GPG keys,
3) Click New SSH key or Add SSH key,
4) Add description to the title;
5) Paste the key into the "Key" field.
We are done.
Reference: https://help.github.com/
相关文章推荐
- How to clone a brach from github
- 遇到从github git clone不下来,报Permission denied (publickey). fatal: Could not read from remote repository.
- git 学习笔记2--How to create/clone a repository
- How to create folder in github repository?
- EGit with eclipse to clone project from GitHub(Step by step)
- How to update a Github forked repository
- How to find error message from OMS repository
- github clone "Permission denied (publickey). fatal: Could not read from remote repository."
- from github clone project to my computer ,something need to be known
- git clone时出现ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from
- EGit with eclipse to clone project from GitHub(Step by step)
- How do I clone a github project to run locally?
- How to Export and Import the AWR Repository From One Database to Another (文档 ID 785730.1)
- how to clone a git repository to local
- how to remote push repository to github--解决403forbidden和publickey问题
- How to create a repository in Github with Eclipse?
- How to Deleting a Storage Repository From the Command Line?
- How To Clone A Database Home From One Server To Other(same SID,directory,path)
- How to create a maven repository for your github project step by step
- *****How to access a repositoryItemButtonEdit value from a FileDlg