1. 首先git clone ”具体git“ 2. 在该文件夹下(注意不要使用--global): git config user.name "your name" git config user.email "your email" 3. 生成密钥文件 ssh-keygen -t rsa -C "you email" 4. 将公钥拷贝到github.com 或者 公司的git网站 5. 为私钥添加config(mac 是在.ssh文件下) Host github.com User your email # 你刚才生成密钥对使用的email地址 Hostname ssh.github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa_github # 注意这个位置是私钥 Port 443 6. 测试是否配置成功: ssh -T git@jHost # Host就是你设置的主机名 显示:Hi your github name! You've successfully authenticated, but GitHub does not provide shell access.表示成功!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)