说明:此笔记在centos 7 上完成
123 | [root@kangvcar ~]# ssh-keygen -t rsa -C "kangvcar@126.com" [root@kangvcar ~]# cat .ssh/id_rsa.pub# 注意:在本地用ssh-keygen生成密钥对后,把公钥添加到github上 |
---|
1 | [root@kangvcar ~]# yum -y install git |
---|
12 | [root@kangvcar ~]# git config --global user.name "kangvcar" [root@kangvcar ~]# git config --global user.email "kangvcar@126.com" |
---|
1234 | [root@kangvcar ~]# mkdir kangvcar [root@kangvcar ~]# cd kangvcar/ [root@kangvcar kangvcar]# git init [root@kangvcar kangvcar]# echo "ni hao kangvcar" >> test.txt |
---|
12 | [root@kangvcar kangvcar]# git add . [root@kangvcar kangvcar]# git commit -m "add test.txt" |
---|
如地址:git@github.com:kangvcar/kangvcar.git
1 | [root@kangvcar kangvcar]# git remote add origin git@github.com:kangvcar/kangvcar.git |
---|
123456 | [root@kangvcar kangvcar]# git push -u origin master Warning: Permanently added the RSA host key for IP address '192.30.255.112' to the list of known hosts. Counting objects: 3, done. Writing objects: 100% (3/3), 222 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To git@github.com:kangvcar/kangvcar.git * [new branch] master -> master Branch master set up to track remote branch master from origin. |
---|