github ssh key 使用

添加ssh id_rsa
ssh-keygen -t rsa -C "[email protected]"

cat ~/.ssh/github/id_rsa.pub|pbcopy 到github SSH keys中 




配置.ssh/config新增
Host github_test
        HostName github.com
        User git
        IdentityFile ~/.ssh/github/id_rsa



测试连接是否成功
ssh -T -v git@github_test


初始化git


echo "test"> readme


git init

git add readme

git commit -m "init"


 git remote add origin github_test:xxxx/xxx.git

git push -u origin master

你可能感兴趣的:(github ssh key 使用)