【问题解决】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

然后就可以了

相关文章
|
8天前
|
开发工具 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 报错如何解决-优雅草卓伊凡
25 3
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
|
8天前
|
安全 开发工具 git
git分布式版本控制系统及在码云上创建项目并pull和push
通过本文的介绍,我们详细讲解了Git的基本概念和工作流程,并展示了如何在码云上创建项目及进行pull和push操作。Git作为一种分布式版本控制系统,为开发者提供了强大的工具来管理代码变更和协作开发。希望本文能帮助您更好地理解和使用Git及码云,提高开发效率和代码质量。
29 16
|
9天前
|
安全 开发工具 git
git分布式版本控制系统及在码云上创建项目并pull和push
通过本文的介绍,我们详细讲解了Git的基本概念和工作流程,并展示了如何在码云上创建项目及进行pull和push操作。Git作为一种分布式版本控制系统,为开发者提供了强大的工具来管理代码变更和协作开发。希望本文能帮助您更好地理解和使用Git及码云,提高开发效率和代码质量。
37 18
|
3月前
|
网络安全 开发工具 git
解决fatal:remote error:You can’t push to git://github.com/username/*.g
通过上述诊断与修复步骤,绝大多数的推送错误都能得到有效解决,确保您的Git工作流顺畅无阻。
299 1
|
4月前
|
存储 开发工具 数据安全/隐私保护
git报错The project you were looking for could not be found 解决方式
git报错The project you were looking for could not be found 解决方式
978 1
|
5月前
|
存储 Shell 开发工具
8-8|windows上Git报错
8-8|windows上Git报错
|
5月前
|
机器学习/深度学习 Shell 开发工具
Python使用管道执行git命令报错|4-7
Python使用管道执行git命令报错|4-7
|
5月前
|
开发工具 git
GIT:如何合并已commit的信息并进行push操作
通过上述步骤,您可以有效地合并已提交的信息,并保持项目的提交历史整洁。记得在执行这些操作之前备份当前工作状态,以防万一。这样的做法不仅有助于项目维护,也能提升团队协作的效率。
218 4
|
9月前
|
开发工具 git
完美解决git 执行git push origin master指令 报错command not found
完美解决git 执行git push origin master指令 报错command not found
261 0
|
开发工具 git
git push origin master提交报错解决办法
git push origin master提交报错解决办法
198 0