Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 584 Bytes

File metadata and controls

23 lines (19 loc) · 584 Bytes

Git 常见问题

[TOC]

1. 一台电脑配置git多用户,在git clone时,发生Permission denied (publickey)

git clone ...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

解决步骤如下:(Windows)

  1. 生成当前用户的key,将生成的公钥、私钥放置需要的地方
ssh-keygen -t rsa -C "***.com"
  1. 将私钥添加ssh-agent中,首先安装ssh-agent服务,然后添加sshkey至ssh-agent
ssh-agent bash
ssh-add ~/.ssh/id_rsa
  1. 将公钥至Github中的SSH中。