本文的操作环境是Ubuntu16.04lts。
第一步:安装的Git
第二步:控制台生成公钥:
ssh-keygen -t rsa -C "your_emali@youemal.com"
一直回车也行,然后将id_rsa.pub复制到github上
第三步:设置用户名和邮箱,控制台操作
git config user.name"you name"
git config user.email"you_email@youemal.com"
第四步:进入你的项目,初始化为仓库,然后.......上传(例)
cd ~/helloworld
git init
git add *
git commit -m 'frist commit'
#git remote add test git@github.com:你的github用户名/github上的仓库名.git
git remote add test git@github.com:kkkk/hello.git
git push -u test master
#这一步可能会出错,出错后执行下边一行
git push -f