当前位置: 首页 > article >正文

git 上传代码时报错

在上传代码时,显示无法上传

PS E:\JavaWeb\vue3-project> git push
To https://gitee.com/evening-breeze-2003/vue3.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/evening-breeze-2003/vue3.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.

提示告诉我们文件版本冲突,我们使用 git pull 合并一下远程仓库的版本和本地的版本,git pull

如果 git pull 拉取失败,可能会提示你是哪些文件有问题,不能上传,或者有冲突

PS E:\JavaWeb\vue3-project> git pull
error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.

我们根据提示,需要我们修改或者删除需要提交的某些文件

我们显示一下所有文件的状态:git status,可以看到 README.md 文件冲突了

我们将这两个文件的提交从 commit 之中删除

然后我们再次拉取,就可以发现拉取成功了

这次我们再进行 git push 操作就不会报错了

最后成功提交代码:


http://www.kler.cn/a/418846.html

相关文章:

  • Python Web 框架
  • Proxy详解
  • Oracle12.2 RAC集群管理修改IP地址(DNS解析)
  • 洛谷 P1558 色板游戏(线段树)
  • 管理表空间和数据文件(二)
  • 江协科技最新OLED保姆级移植hal库
  • 阅文集团大数据面试题及参考答案
  • qt 的udp发送和接收
  • Vue SSR基础介绍与实践
  • Pycharm使用Jupyterlab报错:Jupyter command `jupyter-notebook` not found
  • 计算机毕业设计Python深度学习游戏推荐系统 Django PySpark游戏可视化 游戏数据分析 游戏爬虫 Scrapy 机器学习 人工智能 大数据毕设
  • AI 编译器学习笔记之十三 -- Pytorch 特性实现
  • [golang][MAC]Go环境搭建+VsCode配置
  • 设计模式学习[10]---迪米特法则+外观模式
  • mrRobot解题过程
  • 基于自编码器的深度回归模型:原理、实现与分析
  • Cause: java.sql.SQLException: No value specified for parameter 4
  • 【机器学习】梯度消失和梯度爆炸问题
  • pytorch中一个tensor经过多次softmax会有什么变化?
  • 【Linux课程学习】:《简易版shell实现和原理》 《哪些命令可以让子进程执行,哪些命令让shell执行(内键命令)?为什么?》