IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 开发工具 -> hint: Updates were rejected because the tip of your current branch is behind -> 正文阅读

[开发工具]hint: Updates were rejected because the tip of your current branch is behind

Switched to a new branch 'name'
15:37:02.655: [06-Turbulent_flow_spectrum] git -c credential.helper= -c http.sslBackend=schannel -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/dev_zgd:dev_zgd
error: failed to push some refs to 'http://10.35.161.175/zhaoguandong/mygitlabproject.git'
hint: Updates were rejected because the tip of your current branch is behind
To http://10.35.161.175/zhaoguandong/mygitlabproject.git
!	refs/heads/dev_zgd:refs/heads/dev_zgd	[rejected] (non-fast-forward)
hint: its remote counterpart. Integrate the remote changes (e.g.
Done
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
15:37:58.276: [06-Turbulent_flow_spectrum] git -c credential.helper= -c http.sslBackend=schannel -c core.quotepath=false -c log.showSignature=false rm --ignore-unmatch --cached -r -- .idea/misc.xml

解决用git push origin master时出现的问题
不知道小伙伴们在使用git push origin master时有没有遇到下面的问题,今天我遇到了,原因一般是相同的,下面详细分析一下

报错内容:
To github.com:/
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘git@github.com:/
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@github.com:****** / Demo.git’
提示:由于当前分支的尖端位于其远程对应的后面,因此更新被拒绝。 合并远程更改(例如’git pull’),然后再次推送。 有关详细信息,请参见“ git push --help”中的“关于fast-forwards的注意事项”。
这个报错的原因是因为远程repository和本地的repository有冲突,下面有3种解决办法:

按上面报错内容中所给的提示先用git pull之后再用git push

$ git pull origin master
$ git push origin master

使用强制push的方法,但是这会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候

$ git push origin master -f

如果不想merge远程和本地修改,可以先创建新的分支,然后再push

$ git branch [name]
$ git push origin [name]

  开发工具 最新文章
Postman接口测试之Mock快速入门
ASCII码空格替换查表_最全ASCII码对照表0-2
如何使用 ssh 建立 socks 代理
Typora配合PicGo阿里云图床配置
SoapUI、Jmeter、Postman三种接口测试工具的
github用相对路径显示图片_GitHub 中 readm
Windows编译g2o及其g2o viewer
解决jupyter notebook无法连接/ jupyter连接
Git恢复到之前版本
VScode常用快捷键
上一篇文章      下一篇文章      查看所有文章
加:2022-09-13 11:38:53  更:2022-09-13 11:40:39 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/18 15:02:35-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码