You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Git推送失败报错‘remote: fatal: bad object refs/pull-requests/{id}’求助

Git分支推送失败排查与解决

问题现象

克隆私有仓库后,基于master分支创建test分支,执行推送操作时失败,报错提示远程仓库存在损坏对象。

推送命令及报错输出

$ git push --set-upstream origin test
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: fatal: bad object refs/pull-requests/101/v2
fatal: bad object refs/pull-requests/101/v2
To ssh://git.my_repo_host:9999/my_repo.git
 ! [remote rejected]   test -> test (missing necessary objects)
error: failed to push some refs to 'ssh://git.my_repo_host:9999/my_repo.git'

尝试的无效操作

先后执行git fsck --full和git gc命令,本地仓库检查无异常,但问题未解决:

git fsck --full输出

$ git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (31288/31288), done.
Verifying commits in commit graph: 100% (4081/4081), done.

git gc输出

$ git gc
Enumerating objects: 31288, done.
Counting objects: 100% (31288/31288), done.
Delta compression using up to 8 threads
Compressing objects: 100% (13738/13738), done.
Writing objects: 100% (31288/31288), done.
Total 31288 (delta 15511), reused 31274 (delta 15505), pack-reused 0 

本地仓库配置信息

master分支下执行git config --local -l,无特殊配置:

$ git config --local -l
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=ssh://git@git.my_repo_host:9999/my_repo.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

最终解决结果

IT团队近期维护后导致远程仓库Git数据损坏,经团队修复后,推送操作恢复正常。无法提供具体修复细节。

内容的提问来源于stack exchange,提问作者The Anh Nguyen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 05:50:25