首先本地要有git
将本地文件上传到云
第一步:
本地在项目文件夹里打开git bash,即打开命令行
第二步:
在文件夹里创建 .git
git init
然后创建远程仓库
git remote add origin (云地址)
第三步:
可以先将远程仓库里的拉下来,状态一致
git pull origin master
第四步:
老套路将本地的
git add .
git commmit "描述"
第五步:
将本地的push上去
git pull origin master
遇到问题解决办法:
- 问题一:
Updates were rejected because the remote contains work that you do hint: not have locally.
This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again
See the 'Note about fast-forwards' in 'git push --help' for details. 解决办法:先pull下来,保持同步?参考 -
问题二: Updates were rejected because the tip of your current branch is behind its remote counterpart 解决办法:新建一个分支或者强制push?参考
|