简体   繁体   English

在尝试将我的更改同步到我的存储库时,出现错误“Git:致命:错误 object refs/remotes/origin/main 2”

[英]While trying to sync my changes to my repository I get the error "Git: fatal: bad object refs/remotes/origin/main 2"

While trying to sync my changes to my repository I get the error在尝试将我的更改同步到我的存储库时出现错误

fatal: bad object refs/remotes/origin/main 2 error: https://github.com/username/repository.git did not send all necessary objects

I also don't have any other branches in the repo, so main 2 doesn't exist.我在 repo 中也没有任何其他分支,所以 main 2 不存在。

As I mentioned before , check in your local repository what is corrupted with:正如我之前提到的,检查您的本地存储库中损坏的内容:

git rev-list --verify-objects --stdin --not --all

And: git fsck .并且: git fsck

Check also if you can clone the repository back in a new local folder, to make sure what is currently pushed to GitHub can be accessible again.还要检查您是否可以将存储库克隆回新的本地文件夹,以确保可以再次访问当前推送到 GitHub 的内容。
If you can clone it, then you can import your local commit in it and push back.如果你可以克隆它,那么你可以在其中导入你的本地提交并推回。

But if this is an extra incorrect branch, check the branch list with:但如果这是一个额外的不正确分支,请检查分支列表:

git branch -avv

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 git gc 致命错误坏 object refs/remotes/origin/deleted/deleted.002 - git gc fatal error bad object refs/remotes/origin/deleted/deleted.002 如何处理 git gc fatal: bad object refs/remotes/origin/HEAD 错误? - How to handle git gc fatal: bad object refs/remotes/origin/HEAD error? git gc-致命:错误的对象引用/远程处理/图标 - git gc - fatal: bad object refs/remotes/Icon 在使用 @io_bazel_rules_docker 时运行 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' 时出错 - error running 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' while working with @io_bazel_rules_docker 致命:refspec的远程部分不是.git / refs / heads / master中的有效名称:.git / refs / remotes / origin / master - fatal: remote part of refspec is not a valid name in .git/refs/heads/master:.git/refs/remotes/origin/master msys git导致“致命:无法创建'c:/xxx/.git/refs/remotes/origin/”无法发送” .lock':无效参数”错误 - msys git causing “fatal: Unable to create 'c:/xxx/.git/refs/remotes/origin/”failed-to-sent“.lock ': Invalid argument” error git tag:致命:无法将'refs / remotes / my_tag_name'解析为有效的ref - git tag: fatal: Failed to resolve 'refs/remotes/my_tag_name' as a valid ref Git refs / remotes / origin / master不指向有效对象 - Git refs/remotes/origin/master does not point to a valid object Git:“警告:忽略损坏的 ref refs/remotes/origin/master 错误修订版‘refs/remotes/origin/master..HEAD’ - Git: "warning: ignoring broken ref refs/remotes/origin/master bad revision 'refs/remotes/origin/master..HEAD' Git-svn克隆错误:“致命:不是有效的对象名称'refs / remotes / tags / Tag With Spaces'” - Git-svn clone error: “fatal: Not a valid object name 'refs/remotes/tags/Tag With Spaces'”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM