Git使用常用命令总结2---创建githu…

  1. ssh-keygen -t rsa -C "[email protected]"   :创建SSH Key
  2. 在用户主目录里找到.ssh目录,里面有id_rsa和id_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露出去,id_rsa.pub是公钥,可以放心地告诉任何人
  3. 登陆GitHub,打开“Account settings”,“SSH Keys”页面,然后,点“Add SSH Key”,填上任意Title,在Key文本框里粘贴id_rsa.pub文件的内容
  4. 添加远程库git remote add origin [email protected]:michaelliao/learngit.git
  5. 第一次:git push -u origin master  以后:git push origin master
  6. 从github克隆:git clone [email protected]:你的名字/gitskills.git
  7. 注意:github上的东西任何人都可以看,除非缴费变成私有

你可能感兴趣的:(Git使用技巧)