首先远程仓库有github、gitee等等一些,都是需要设置密钥对才能让你的本机有操作仓库的权限的
ssh 密钥对设置
- linux 在 ~/.ssh ,window在Git bash命令行窗口(似乎模拟的linux命令窗口)输入
- ssh-keygen -t rsa -C "你的邮箱"
- 一路回车不用输入任何信息,生成密钥对
- add私钥
- 如果报错Could not open a connection to your authentication agent.如下:
- eval `ssh-agent`或者后面这个ssh-agent bash
- ssh-add ~/.ssh/id_rsa
- 如果报错Could not open a connection to your authentication agent.如下:
- cat ~/.ssh/id_rsa.pub 查看公钥
- git clone (你的仓库的url复制)
-