1、git init
2、git add . (.代表的是提交该目录下所有的文件) 3、git commit -m 提交说明 4、git remote add origin 远程仓库地址
5、git pull origin master
6、git push origin master 把本地库的内容推送到远程,使用 git push命令,实际上是把当前分支master推送到远程。执行此命令后会要求输入用户名、密码,验证通过后即开始上传。
如果报错
hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 不要换,接着执行 git push -u origin master -f (强制上传),
至此 搞定!