安装 Git 和使用
大约 1 分钟
下载
打开官网 https://git-scm.com/download

选择对应的系统下载即可,我这里是Windows版本,点击 Download for Windows
后点击 Click here to download
即可

安装
无脑下一步即可

使用
打开Git Bash
设置自己的用户名和邮箱
git config --global user.name 你的用户名
git config --global user.email 你的邮箱
# 查看是否配置成功
git config --global user.name
git config --global user.email

- 获取SSH公钥
如果你是新安装的一般需要生成你的SSH公钥
# 生成公钥,一路回车即可
ssh-keygen -t rsa
# 查看公钥
cat ~/.ssh/id_rsa.pub
- 验证GitHub
复制这一块全部的SSH公钥

打开 GitHub -> Settings -> SSH and GPG keys -> New SSH key

把复制的SSH公钥粘贴进去,然后点击下方的 Add SSH key
按钮即可

结束
接下来就是在GitHub创建相应的仓库,并且完成对应的设置,再把代码推送上去即可。