没有不值得去解决的问题,也没有不值得去学习的技术!

在 TortoiseGit 中拉取时,报错:error: some local refs could not be updated; try running ‘git remote prune origin’ to remove any old, conflicting branches

仔细查看提示信息,发现存在:error: cannot lock ref 'refs/remotes/origin/sc/fix/to-be-merged-table-scroller': 'refs/remotes/origin/sc/fix' exists; cannot create 'refs/remotes/origin/sc/fix/to-be-merged-table-scroller'
1、在 TortoiseGit 中拉取时,报错:error: some local refs could not be updated; try running ‘git remote prune origin’ to remove any old, conflicting branches。如图1
在 TortoiseGit 中拉取时,报错:error: some local refs could not be updated; try running 'git remote prune origin' to remove any old, conflicting branches。
图1


git.exe pull --progress -v --no-rebase "origin"
POST git-upload-pack (165 bytes)
From https://git.xxx.com/object/frontend
= [up to date]          develop                 -> origin/develop
= [up to date]          0.22.0-hotfix           -> origin/0.22.0-hotfix
= [up to date]          antd5                   -> origin/antd5
= [up to date]          hotfix/outbound-order   -> origin/hotfix/outbound-order
= [up to date]          master                  -> origin/master
= [up to date]          od/feat/batch-merge-order -> origin/od/feat/batch-merge-order
= [up to date]          od/feat/count           -> origin/od/feat/count
= [up to date]          od/feat/dispute         -> origin/od/feat/dispute
= [up to date]          od/feat/download-order  -> origin/od/feat/download-order
= [up to date]          od/feat/merge-order-optimize -> origin/od/feat/merge-order-optimize
= [up to date]          od/feat/return          -> origin/od/feat/return
= [up to date]          od/feat/status          -> origin/od/feat/status
= [up to date]          od/feat/warehouse-matching -> origin/od/feat/warehouse-matching
= [up to date]          opt/virtual-table       -> origin/opt/virtual-table
= [up to date]          pdc/feat/add-sort-field -> origin/pdc/feat/add-sort-field
= [up to date]          pdc/feat/image-center   -> origin/pdc/feat/image-center
= [up to date]          pdc/feat/sku-form       -> origin/pdc/feat/sku-form
= [up to date]          pdc/feat/spu-export     -> origin/pdc/feat/spu-export
= [up to date]          pdc/feat/track          -> origin/pdc/feat/track
= [up to date]          sc/1688-opt-test        -> origin/sc/1688-opt-test
= [up to date]          sc/appendix-upload      -> origin/sc/appendix-upload
= [up to date]          sc/feat/purchase-order-ui -> origin/sc/feat/purchase-order-ui
error: cannot lock ref 'refs/remotes/origin/sc/fix/to-be-merged-table-scroller': 'refs/remotes/origin/sc/fix' exists; cannot create 'refs/remotes/origin/sc/fix/to-be-merged-table-scroller'
! [new branch]          sc/fix/to-be-merged-table-scroller -> origin/sc/fix/to-be-merged-table-scroller  (unable to update local ref)
= [up to date]          sc/fixs                 -> origin/sc/fixs
= [up to date]          sc/manual-marking       -> origin/sc/manual-marking
= [up to date]          sc/old-out-of-stock     -> origin/sc/old-out-of-stock
= [up to date]          sc/purchase-list-opt    -> origin/sc/purchase-list-opt
= [up to date]          stage                   -> origin/stage
= [up to date]          test                    -> origin/test
= [up to date]          wh/feat/all-order-export -> origin/wh/feat/all-order-export
= [up to date]          wh/feat/deactivated-warehouse -> origin/wh/feat/deactivated-warehouse
= [up to date]          wh/feat/delivery        -> origin/wh/feat/delivery
= [up to date]          wh/feat/examine         -> origin/wh/feat/examine
= [up to date]          wh/feat/hot-outbound    -> origin/wh/feat/hot-outbound
= [up to date]          wh/feat/in-order        -> origin/wh/feat/in-order
= [up to date]          wh/feat/in-outbound-order-batch-add-custom-sku -> origin/wh/feat/in-outbound-order-batch-add-custom-sku
= [up to date]          wh/feat/modify-position-sku-custom-code -> origin/wh/feat/modify-position-sku-custom-code
= [up to date]          wh/feat/multi-position  -> origin/wh/feat/multi-position
= [up to date]          wh/feat/opt-log         -> origin/wh/feat/opt-log
= [up to date]          wh/feat/order-batch_no  -> origin/wh/feat/order-batch_no
= [up to date]          wh/feat/outbound-order-api -> origin/wh/feat/outbound-order-api
= [up to date]          wh/feat/quick-multi-class-outbound -> origin/wh/feat/quick-multi-class-outbound
= [up to date]          wh/feat/quick-outbound  -> origin/wh/feat/quick-outbound
= [up to date]          wh/feat/quick-single-deliver -> origin/wh/feat/quick-single-deliver
= [up to date]          wh/feat/storage-in-log-export -> origin/wh/feat/storage-in-log-export
= [up to date]          wh/feat/transfer-export -> origin/wh/feat/transfer-export
= [up to date]          wh/feat/transfer-import -> origin/wh/feat/transfer-import
= [up to date]          wh/feat/warehouse-order -> origin/wh/feat/warehouse-order
= [up to date]          wh/fix/custom-text-table -> origin/wh/fix/custom-text-table
= [up to date]          wh/fix/order-selected-keys -> origin/wh/fix/order-selected-keys
error: some local refs could not be updated; try running
'git remote prune origin' to remove any old, conflicting branches


git 未能顺利结束 (退出码 1) (5328 ms @ 2024/04/30 10:09:10)



2、仔细查看提示信息,发现存在:error: cannot lock ref ‘refs/remotes/origin/sc/fix/to-be-merged-table-scroller’: ‘refs/remotes/origin/sc/fix’ exists; cannot create ‘refs/remotes/origin/sc/fix/to-be-merged-table-scroller’ 。如图2
仔细查看提示信息,发现存在:error: cannot lock ref 'refs/remotes/origin/sc/fix/to-be-merged-table-scroller': 'refs/remotes/origin/sc/fix' exists; cannot create 'refs/remotes/origin/sc/fix/to-be-merged-table-scroller'
图2
3、参考:在 TortoiseGit 中拉取时,报错:error: cannot lock ref ‘refs/remotes/origin/sc/fix’: ‘refs/remotes/origin/sc/fix/to-be-merge-order’ exists; cannot create ‘refs/remotes/origin/sc/fix’ https://www.shuijingwanwq.com/2024/03/30/8496/ 。得以解决。 4、在 Git Bash 中执行命令:git update-ref -d refs/remotes/origin/sc/fix/to-be-merged-table-scroller。


Lenovo@DESKTOP-QLPK8QM MINGW64 /e/wwwroot/object (develop)
$ git update-ref -d refs/remotes/origin/sc/fix/to-be-merged-table-scroller
error: cannot lock ref 'refs/remotes/origin/sc/fix/to-be-merged-table-scroller': 'refs/remotes/origin/sc/fix' exists; cannot create 'refs/remotes/origin/sc/fix/to-be-merged-table-scroller'
Lenovo@DESKTOP-QLPK8QM MINGW64 /e/wwwroot/object (develop)
$ git update-ref -d refs/remotes/origin/sc/fix



5、再次在 TortoiseGit 中拉取,不再报错,拉取成功

需要长期技术维护或远程问题排查?

我是拥有 15+ 年经验的 PHP / Go 后端工程师,长期关注已有系统维护、Bug 修复、性能优化、服务器排查、WordPress 网站维护和小功能迭代。

如果你的项目遇到以下情况,可以先从一次小问题排查开始合作:

  • ✅ PHP / Laravel / Yii2 老项目无人维护
  • ✅ Go / Gin 后端接口需要排查或优化
  • ✅ WordPress 网站访问慢、报错或插件冲突
  • ✅ Nginx / MySQL / Redis / Linux 服务器异常
  • ✅ CDN / Cloudflare / DNS / HTTPS 配置问题
  • ✅ 需要长期远程技术支持或兼职维护

更多介绍请查看:关于我 & 合作

微信:13980074657
邮箱:shuijingwanwq@gmail.com
Telegram:@shuijingwan
GitHub:https://github.com/shuijingwan

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理