git下载、安装、连接github

0.下载git

官网下载速度慢,下载不下来
阿里云下载地址:https://npm.taobao.org/mirrors/git-for-windows/


1.安装git

linux:
在命令行直接输入:git,查看结果,有没有安装。
如果没有安装,sudo apt install git


2.设置姓名和邮箱及命令行输出颜色`

git config --global user.name "Mike"
git config --global user.email "z_runwei@163.com"
git config --global color.ui auto


3.创建 SSH Key

ssh-keygen -t rsa -C "your_email@example.com"
* 显示:
Generating public/private rsa key pair.
Enter file in which to save the key
(/Users/your_user_directory/.ssh/id_rsa): 按回车键
Enter passphrase (empty for no passphrase): 输入密码3307086;一般不输入密码,直接回车
Enter same passphrase again: 再次输入密码


4.在github网站上注册账号并登陆


5.在GitHub中添加公开密钥,今后就可以用私有密钥进行认证了。


6.测试:

用手中的私人密钥与GitHub进行认证和通信
ssh -T git@github.com


7.在github建立仓库


8.在命令行clone仓库

git clone git@github.com:zrunwei/HelloWorld.git(ssh传输协议)
git clone https://github.com/zrunwei/HelloWorld [myHelloWorld](http传输协议)

原文地址:https://www.cnblogs.com/Mike_Chang/p/9383930.html