just a test project
- cd ~/.ssh
- ssh-keygen -t rsa -C "[email protected]" -f "github_rsa"
- ssh-keygen -t rsa -C "[email protected]" -f "gitee_rsa"
- 会生成四个文件github_rsa github_rsa.pub gitee_rsa gitee_rsa.pub把生成的pub文件内容复制到github profile和gitee profile下面的ssh key上
- 创建一个文件文件叫 config ,内容如下:
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee_rsa
# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github_rsa
执行 ssh -T [email protected] 成功则返回 Hi xxx! You've successfully authenticated, but GITEE.COM does not provide shell access.
执行 ssh -T [email protected] 成功则返回 Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
- 在github上新建好项目
- 在本地目录上初始化工作 git init
- 加入远程目录git remote add origin [email protected]:yourgithubname/repo.git
- 把文件拉下来吧 git pull
- 切换到master分支吧 git checkout master