申明:本内容纯手写,可能存在部分命令错误,请理解,联系上下文理解下咯~~~
从idea中拉去项目一直失败,不得已换个思路:
1、项目将要存放的目标路径下,右键:Git Bash Here
$ git init
2、检查本地是否存在SSH KEY,如果已经存在跳转至第6步:
$ ls ~/.ssh/
3、本地配置gitHub账号:
$ git config --global user.name "yourEmail@XXX.com"
4、在本地生成ssh key:
$ ssh-keygen -t rsa -C"yourEmail@XXX.com"
[过程内容]
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/zhangxm/.ssh/id_rsa):[type enter]
/c/Users/zhangxm/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):[建议输入与github登录密码相同]
Enter same passphrase again:[建议输入与github登录密码相同]
Your identification has been saved in /c/Users/zhangxm/.ssh/id_rsa.
Your public key has been saved in /c/Users/zhangxm/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:sdfafdsfdfadsfasdffadfafadsda
[过程内容]
5、将SSH key 添加到git:
打开/Users/zhangxm/.ssh/id_rsa.pb文件,复制里面的内容粘贴到github-->settings-->SSH and GPG keys 的SSH keys中
6、从项目仓库提取项目至本地
#$ git clone https://github.com/XXX/XXXX.git若返回:empty from server 则更换通道如下
$ git clone git@github.com:XXX/XXXX.git
祝你顺利!!!!