git add .(文件name) //添加文件到本地仓库
git commit -m “first commit” //添加文件描述信息
git remote add origin + 远程仓库地址 //链接远程仓库,创建主分支
git push -u origin master //把本地仓库的文件推送到远程仓库
要想解决以上错误,只需要在4,5之间使用git pull origin master即可
正确步骤:
1. git init //初始化仓库git add .(文件name) //添加文件到本地仓库
git commit -m “first commit” //添加文件描述信息
git remote add origin + 远程仓库地址 //链接远程仓库,创建主分支
git pull origin master // 把本地仓库的变化连接到远程仓库主分支
git push -u origin master //把本地仓库的文件推送到远程仓库
- 当推送的时候,报 (non-fast-forward),使用强制推送即可:git push --force origin master
2021-04-08 23:22:37git 推送更新出现错误: Updates were rejected because the remote contains work that you do
您现在的位置是: 首页 > php > git 推送更新出现错误: Updates were rejected because the remote contains work that you do
当建立新的仓库,推送本地代码带远程服务器,出现这样的错误,直奔主题吧:
git的提交步骤:
1. git init //初始化仓库
OK
搞定!!
关键字词: git 推送更新出现错误: Updates were rejected because the remote contains work that you do
上一篇: git命令-操作演示