vue 项目上传到码云 解决push失败

  • git pull 之后 运行git push 报以下错误;原因是GitHub远程仓库中的README.md文件不在本地仓库中。
$ git push -u origin master
Username for 'https://gitee.com': xxx
To https://gitee.com/xxx.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/xxx.git'
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.
  • 解决办法
  • 我们把-u改成-f即可
$ git push -f origin master
Username for 'https://gitee.com/xxx
Counting objects: 76, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (72/72), done.
Writing objects: 100% (76/76), 3.07 MiB | 981.00 KiB/s, done.
Total 76 (delta 0), reused 0 (delta 0)
remote: Powered by Gitee.com
To https://gitee.com/xxx.git
 + f452e83...c726194 master -> master (forced update)

vue 项目上传到码云 解决push失败_第1张图片
完美收工。

你可能感兴趣的:(git-常用)