首先申请在github官网申请一个账号。
登录账号然后创建一个仓库,如图
然后填写信息如图
点击Create repository创建。接着跳转到。https://github.com/mimao/test3.git这个就是你上传项目的路径(这里是test3因为创建的时候名字是test3,)。
接着下载安装git。
安装完后桌面点击右键,然后选着Git bash here
会弹出小黑框。
接着克隆github的项目根文件下来。
把你的项目文件放进桌面关联的文件夹,test3
文字的操作后面都截图
加入git报出的警告,所以要把core.autocrlf=true,true改为false
命令:$ git config core.autocrlf false
接着输入命令:$ git commit -m "first commit"
然后命令:$ git push
弹出以下信息
fatal: The current branch master has no upstream branch.To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
然后就输入命令git push --set-upstream origin master
最后推入命令:$ git push --set-upstream origin master