git 错误 fatal: loose object...is corrupt解决方法

git 错误 fatal: loose object...is corrupt解决方法

error: object file .git/objects/d2/e3130af1e4f5f0a94d8290efa2149dcc08b303 is empty
error: object file .git/objects/d2/e3130af1e4f5f0a94d8290efa2149dcc08b303 is empty
fatal: loose object d2e3130af1e4f5f0a94d8290efa2149dcc08b303 (stored in .git/objects/d2/e3130af1e4f5f0a94d8290efa2149dcc08b303) is corrupt

解决方法:

    $ rm -fr .git  

    $ git init  

    $ git remote add origin your-git-remote-url  

    $ git fetch  

    $ git reset --hard origin/master  

    $ git branch --set-upstream-to=origin/master master   
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当出现错误提示"fatal: 'origin.master' does not appear to be a git repository fatal: Could not read from remote repository."时,这通常是由于本地分支未与远程仓库建立联系导致的。以下是解决该问题的步骤: 1. 确认本地分支已与远程仓库建立联系。可以使用以下命令检查是否已经建立联系:git remote -v。如果没有显示任何输出,表示本地分支尚未与远程仓库建立联系。 2. 如果本地分支尚未与远程仓库建立联系,可以通过以下命令重新关联:git remote add origin [远程仓库地址]。请将[远程仓库地址]替换为你的实际远程仓库地址。 3. 确认关联成功后,再次使用git remote -v命令检查是否已经建立联系。 4. 最后,使用git push命令将本地分支推送到远程仓库:git push -u origin master。 通过以上步骤,你应该能够成功解决"fatal: 'origin.master' does not appear to be a git repository fatal: Could not read from remote repository."的问题,并将本地分支推送到远程仓库。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Git出现 fatal: ‘origin‘ does not appear to be a git repository fatal: Could not read from remote的...](https://blog.csdn.net/weixin_47872288/article/details/124944945)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [[git]报错fatal: ‘origin‘ does not appear to be a git repository Could not read from remote ...](https://blog.csdn.net/m0_56982300/article/details/129473306)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值