配置git
// 绑定用户
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
// 配置 SSH
ssh-keygen -t rsa -C "youremail@example.com"
下载远程repo
// 在terminal测试是否可用
ssh -T git@github.com
// 克隆repo,注意此处有坑,要拷贝git@...,不要https@...,不然以后上传需要输入账号密码.
git clone git@github.com:quincy-deng/20190527-rmyy
// 补救措施
git remote rm origin
git remote add origin git@github.com:quincy-deng/20190527-rmyy
上传文件到github
//上传文件
git add .
git commit -m '1st'
git push -u origin master
git push
有用的command
// 初始化
git init
// 查看状态
git status
// 删除远程文件
git rm -r --cached json.txt
git commit -m
git push