首页 > 其他分享 >git报错系列---unable to update local ref

git报错系列---unable to update local ref

时间:2024-10-25 08:49:01浏览次数:1  
标签:origin git bag objects 报错 lozen done ref

报错:

root@928c09c89c1c:/home/work/bag# git pull
error: cannot lock ref 'refs/remotes/origin/lozen/remux': 'refs/remotes/origin/lozen' exists; cannot create 'refs/remotes/origin/lozen/remux'
From git.baijiashilian.com:LLL/gloud/bag
! [new branch] lozen/remux -> origin/lozen/remux (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/lozen/tc': 'refs/remotes/origin/lozen' exists; cannot create 'refs/remotes/origin/lozen/tc'
! [new branch] lozen/tc -> origin/lozen/tc (unable to update local ref)

解决方案:

1、清除松散对象

git gc --prune=now

执行过程

root@928c09c89c1c:/home/work/bag# git gc --prune=now
Enumerating objects: 3534, done.
Counting objects: 100% (3534/3534), done.
Delta compression using up to 64 threads
Compressing objects: 100% (1211/1211), done.
Writing objects: 100% (3534/3534), done.
Total 3534 (delta 2306), reused 3450 (delta 2230)

 

2、刷新本地分支

同步远程仓库分支到本地,删除远程分支不存在但是本地还有的分支,执行过程如下:

root@928c09c89c1c:/home/work/bag# git remote prune origin
Pruning origin
URL: [email protected]:LLL/gloud/bag.git
 * [pruned] origin/lozen

3、拉取远端仓库代码

完成上面的两个步骤之后,我们就可以同步代码了,执行过程如下:

root@928c09c89c1c:/home/work/bag# git pull
remote: Enumerating objects: 123, done.
remote: Counting objects: 100% (123/123), done.
remote: Compressing objects: 100% (88/88), done.
remote: Total 123 (delta 69), reused 63 (delta 35), pack-reused 0
Receiving objects: 100% (123/123), 99.65 KiB | 2.93 MiB/s, done.
Resolving deltas: 100% (69/69), completed with 1 local object.
From git.baijiashilian.com:LLL/gloud/bag
 * [new branch]      lozen/remux -> origin/lozen/remux
 * [new branch]      lozen/tc    -> origin/lozen/tc
Already up to date.

 

标签:origin,git,bag,objects,报错,lozen,done,ref
From: https://www.cnblogs.com/zhengwei-cq/p/18501704

相关文章

  • 如何清空git远程库
    清空git远程库的步骤:1.备份重要数据;2.确定清空的目的;3.移除所有分支;4.删除标签(如果需要);5.清除Git对象;6.强制推送;7.警告和注意事项。在清空Git远程库之前,首先要确保重要的数据已经备份。1.备份重要数据在清空Git远程库之前,首先要确保重要的数据已经备份。这包括项目的最新代码......
  • 如何在Git中修改分支的名字
    ​在Git中修改分支的名字需遵循以下步骤:1.确保目标分支是当前活跃分支;2.使用命令行重命名分支;3.更新远程仓库的分支名及其关联;4.告知团队成员分支名的变动。在操作前,需要明确为什么要更改分支名以确保流程的顺畅。1.确保目标分支是当前活跃分支在Git中,想要更改一个分支的名字......
  • mac scrcpy 报错 does not exist or is not a regular file,ERROR: Server connection
    scrcpymac与极空间冲突问题:➜~scrcpyscrcpy2.7<https://github.com/Genymobile/scrcpy>INFO:ADBdevicefound:INFO:-->(usb)8AJY0LU0QdevicePixel_3_XLstat:NosuchfileordirectoryERROR:'/Applications/极空间.ap......
  • vue3开启eslint报错:ESLint error: Parsing error: ‘>‘ expected,vue文件tsx语法报错解
    出错代码部分<scriptlang="tsx">import{defineComponent}from'vue';importMyComponentfrom'./components/childAbc';constApp=defineComponent({name:'App',setup(){return()=>(<div&......
  • [Flink SQL] FlinkCdcSqlJob启动时因MYSQL serverTimeZone而报错:`The MySQL server ha
    1问题描述FlinkCdcSqlJob启动时报错...Causedby:org.apache.flink.table.api.ValidationException:TheMySQLserverhasatimezoneoffset(0secondsaheadofUTC)whichdoesnotmatchtheconfiguredtimezoneAsia/Shanghai.Specifytherightserver-time-z......
  • 【Azure Function】Python Function部署到Azure后报错No module named '_cffi_backend
    问题描述本地使用Python编写的FunctionApp,发布到AzureFunction后,出现 _cffi_backendmodule无法找到的报错。ERROR:Error:Nomodulenamed'_cffi_backend',Cannotfindmodule.Pleasechecktherequirements.txtfileforthemissingmodule.Formoreinfo,plea......
  • 利用这些 Git 最佳实践成为更好的开发人员(译)
    如果您是开发人员,您可能每天都会使用名为Git的版本控制系统。无论是团队合作还是个人开发,使用此工具对于应用程序的开发过程都至关重要。但是,通常会遇到混乱的存储库、提交信息不明确(无法传达有用信息)以及分支滥用等问题。对于那些想要在就业市场上脱颖而出的人来说,了解如何正确......
  • pycharm配置git版本控制
    今天记录一下如何在pycharm工具中配置git版本控制,主要分以下步骤:1、安装git首先需要有git环境,去git官网下载git安装包,下一步下一步执行安装完成即可2、在pycharm中配置git路径下载git后,在pycharm的settings菜单中输入“git”,配置git.exe的路径。点击下图中Test按钮,返回git......
  • 基于vben框架的vue前端代码编译时报错
    在Node18.16和16.20版本下使用vben框架时,遇到pnpminstall报错关于eslint-config缺失的问题,解决方案是通过添加pnpm-workspace.yaml文件并指定内部依赖,确保`@vben/eslint-config`版本配置正确。问题描述node18.16/node16.20中编译vben框架的vue前端代码,pnpminstall报错:"@v......
  • 阿里旺旺gdiplus.dll报错?阿里旺旺gdiplus.dll常见错误及解决方案大放送
    针对阿里旺旺gdiplus.dll报错的问题,以下是一些常见的错误类型及其解决方案的大放送:一、gdiplus.dll文件缺失或损坏现象:阿里旺旺无法正常启动。在运行过程中出现图形界面错误、程序崩溃等问题。解决方案:重启计算机:有时,系统中的临时问题可能导致gdiplus.dll文件未正常......