1,安装git
sudo apt-get install git
2,配置ssh key
a) 生成ssh key
ssh-keygen -t rsa -C "your_email@youremail.com"
b) 回到github,进入Account Settings,左边选择SSH Keys,Add SSH Key,title随便填,粘贴key。key就是~/.ssh/id_rsa.pub
c) 测试ssh key是否成功
ssh -T git@github.com
3,配置Git的配置文件,username和email
git config --global user.name "your name" //配置用户名
git config --global user.email "your email" //配置email
4,上传代码
git add .
git commit -m "first commit"
git remote add origin https://github.com/xxxx/xxxx.git
git push -u origin master