Create a new repository on the command line touch README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/supermanmwg/linuxKernel.git git push -u origin master Push an existing repository from the command line git remote add origin https://github.com/supermanmwg/linuxKernel.git git push -u origin master 在上传的过程遇到了github push错误The requested URL returned error: 403 Forbidden while accessing 解决方案: vim .git/config 修改 [remote "origin"] url = https://github.com/supermanmwg/linuxKernel.git为:[remote "origin"] url = https://supermanmwg@github.com/supermanmwg/linuxKernel.git然后重新git push -u origin master输入登录账号的密码即可。