【问题解决】Git报错:failed to push some refs to xxxxx

简介: Git报错:failed to push some refs to xxxxx

Git报错:failed to push some refs to xxxxx

To https://xxxxxxxxxxxx.git

! [rejected] master -> master (fetch first)

error: failed to push some refs to ‘https://xxxxxxxx.git

hint: 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.

hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.

解决方法1:(此方法将导致仓库数据统计中的贡献者只有最后一个上传者)

若远程分支上那些提交都不需要了

直接输入git push origin master -f,强行让本地分支覆盖远程分支。:

解决方法2:

2.1.Git Bash here:(如果鼠标右键有Git Bash here的话可以跳过这个部分)

右键显示Git Bash here

window+r

找到shel的位置

左边新建一个项,右边新建一个字符串值

左边的项,修改为Git Bash Here,右边修改为Icon

找到你之前下的git的文章地址,找到git bash.exe文件地址,将这个地址放到Git Bash Here中去

在Git Bash Here下建一个项

项的名称改为command

点击默认

将其中的值改为地址 +空格+“–cd=%v.”

然后就好啦

2.2.git clone 地址

如果出现下面这种情况git init一下

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dD3W2AEp-1681395928894)(C:\Users\小卢\AppData\Roaming\Typora\typora-user-images\image-20230413191622253.png)]

2.3三个命令

三个命令

  • **git add ***
  • git conmit -m ‘“hello”
  • git push origin master

然后就可以了

相关文章
|
2月前
|
安全 开发工具 git
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
268 5
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
|
5月前
|
算法 安全 网络安全
git clone操作报错diffie-hellman-group1-sha1的解决方案
在处理这一问题时,需要确保了解相关操作的安全影响。`diffie-hellman-group1-sha1`算法被认为是不够安全的,这是因为随着计算能力的提高,`SHA-1`算法可以在合理的时间内被破解,而且其对应的 `1024位`Diffie-Hellman组也可能不够强大。因此,在确保Git操作的同时,也要考虑提升安全性的长期解决办法。强烈推荐与管理员或相关技术支持团队合作,升级和加强服务器端的安全配置。
138 12
|
8月前
|
Shell 开发工具 git
解决git bash报错:在仓库中检测到可疑的所有权
总的来说,解决“在仓库中检测到可疑的所有权”的报错,关键在于理解和调整文件或目录的所有权。只要我们正确地设置了文件或目录的所有权,那么我们就可以避免这种问题,让Git Bash正常工作。
293 22
|
9月前
|
开发工具 git 索引
warning: You ran ‘git add’ with neither ‘-A (—all)’ or ‘—ignore-removal’,报错如何解决 git报错 ‘git add —ignore-removal <pathspec>优雅草卓伊凡
warning: You ran ‘git add’ with neither ‘-A (—all)’ or ‘—ignore-removal’,报错如何解决 git报错 ‘git add —ignore-removal <pathspec>优雅草卓伊凡
181 21
warning: You ran ‘git add’ with neither ‘-A (—all)’ or ‘—ignore-removal’,报错如何解决 git报错 ‘git add —ignore-removal <pathspec>优雅草卓伊凡
|
6月前
|
Linux 开发工具 git
解决 Linux git push 成功后(但没有出现绿点)的问题
最近学习使用Git,发现有时候在Linux下提交自己的小绿点并没有增加,单在仓库中却可以看到提交的代码。看着连续的绿点中出现几个零零散散的灰点,着实让一个强迫症患者十分难受。接下来分享以下我所知道的问题。
149 0
|
6月前
|
网络协议 开发工具 git
解决 git 报错 “fatal: unable to access ‘https://github.com/.../.git‘: Recv failure Connection was rese
在使用 Git/Git小乌龟 进行代码管理的过程中,经常会遇到各种各样的问题,其中之一就是在执行 git clone 或 git pull 等操作时出现 “fatal: unable to access ‘https://github.com/…/.git’: Recv failure Connection was reset” 的报错。这个问题通常是由网络连接问题或代理设置不正确导致的。在我的个人使用经验中,我亲自尝试了四种方法,它们都能够有效地解决这个报错。个人比较推荐方法二。
3136 0
|
10月前
|
开发工具 git
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
783 3
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
|
3月前
|
开发工具 git
Git版本控制工具合并分支merge命令操作流程
通过以上步聚焦于技术性和操作层面指南(guidance), 可以有效管理项目版本控制(version control), 并促进团队协作(collaboration).
461 15
|
6月前
|
安全 开发工具 git
git的常用操作命令
git的常用操作命令
402 57