1.在本地创建ssh key
$ ssh-keygen -t rsa -C "your_email@youremail.com"
2.打开提示的目录中id_rsa.pub里面内容,复制里面的key到github上
3.在github上面创建一个仓库,按照github上的提示在本地执行命令:
We recommend every repository include a README, LICENSE, and .gitignore.
…or create a new repository on the command line
echo "# work" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/SineXue/work.git
git push -u origin master
…or push an existing repository from the command line
git remote add origin https://github.com/SineXue/work.git
git push -u origin master
…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.