1 | ssh-keygen -t rsa -C "[email protected]" // 添加key |
.ssh目录添加config文件
修改内容1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19Host *.a.com
IdentityFile ~/.ssh/id_rsa
User WWW
Host github.com
IdentityFile ~/.ssh/github
User YYY
Host git.coding.net
IdentityFile ~/.ssh/coding
User XXX
// Host github2
// HostName github.com
// IdentityFile ~/.ssh/github
// User YYY
// 使用方式:
// git clone github2:YYY/Mywork.git
// git clone [email protected]:YYY/Mywork.git
参考:
http://www.cnblogs.com/BeginMan/p/3548139.html
http://www.tuicool.com/articles/7nMBVf