You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugConfirmed bugs or reports that are very likely to be bugspriority-2Bug that affects more than a few users in a meaningful way but doesn't prevent core functions
error: cannot lock ref 'refs/remotes/origin/jetty-9.4.x': is at d8e0f8df1206536612c938b63ae677d2352de14b but expected ddd80deeb96eed136029b944258b36b285af79c6
From github.com:eclipse/jetty.project
! ddd80deeb9..d8e0f8df12 jetty-9.4.x -> origin/jetty-9.4.x (unable to update local ref)
* [new branch] jetty-9.4.x-2828-http2_connection_listener_contention -> origin/jetty-9.4.x-2828-http2_connection_listener_contention
Version 1.3.3
$ git --version
git version 2.18.0
macOS 10.13.6
Reacted by Johannes Kalliauer, Arkadi Berikashvili, Rayhan Yulanda, Constantin Bugneac, Ben Bodenmiller, RomilShah, Engincan VESKE, vipin-chander-30084709, Mayank Kumar and Cryo
On windows, happens to me nearly every time.
Same exact error as you:
error: cannot lock 'ref/remotes/origin/blahblahblah': is at something but expected somethingelse
Hacky workaround I've been doing is a combination of:
running: git gc --prune=now
and deleteing .git/refs/remote/origin
Reacted by Amarjeet Kawathe, TinhNN, Kerem Demirer, Kacper Potyrała, Xiaojuan Xu, saffaura, Patrick, lcycug, Jitesh Sojitra, zwfengwu and 191 more
Reacted by Rob Farthing, KiddyTheKid, Malek Boubakri, Utkarsh Narain Srivastava, Siva, nmkleiner, todo, linhdam961602, Ahmad H. Ibrahim, Dinh Huynh and 14 more
Reacted by Luigi Di Mauro, Mahmoud Elsheikh, Yair Baruch, Jay Patel, Malek Boubakri, Siva, ZacharyZ, Ryan Gates, Valter Neto, todo and 29 more
Reacted by jiaccanche, Mahmoud Elsheikh, Yair Baruch, Jay Patel, Malek Boubakri, Siva, Ryan Gates, Valter Neto, awlyg, Ashwanth A R and 24 more
Reacted by Polo, Malek Boubakri, Siva, Ashwanth A R, davidz, todo, linhdam961602, brendan, Ahmad H. Ibrahim, Dinh Huynh and 19 more
Reacted by Siva, Igor Piskunov, mphealy, linhdam961602, Mateusz Sokołowski, Ahmad H. Ibrahim, Ali Torki, Daria Moreno-Gogoleva, Teodor Ivanov, Wayne Cabanto and 9 more
This error is often a symptom of more than one process trying to act on the same repository at the same time.
@natros could you verify if you are using other tools to manage your repository while Desktop is open (some IDEs and text editors have git plugins that may access your repository)?
cc @desktop/support
Reacted by Adam van der Kruk, Cook, Yuping Zhang, Ehsaan Israr, Kumar Abinash, Samip Poudel, Eno Ekanem and raweber
i'm not using other tools, just using this to keep up to date with last changes from a few repositories. the one that most often is causing me problems is this repo:
error: cannot lock ref 'refs/remotes/origin/jetty-9.4.x': is at 5b5f2fcf5f8241dd9edb998b97ad5e6cd45130a8 but expected 33a1367325530ec38254a279abb30946505af485
From github.com:eclipse/jetty.project
! 33a1367325..5b5f2fcf5f jetty-9.4.x -> origin/jetty-9.4.x (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/jetty-9.3.x': is at 29d466e7046bfd2c67d50194a606ed5276a6c8f9 but expected bd143a674ba7fbb3c7e7e450c8102e9a4bd95172
! bd143a674b..29d466e704 jetty-9.3.x -> origin/jetty-9.3.x (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/jetty-9.4.x-2711-tls_13_compliance': is at eadb7469ea009042a4bc23f1c16173c06c9d68a7 but expected f51c205c6fcdfee412f13a428a81dc2fd148e2ae
! f51c205c6f..eadb7469ea jetty-9.4.x-2711-tls_13_compliance -> origin/jetty-9.4.x-2711-tls_13_compliance (unable to update local ref)
GitHub Desktop Version 1.4.0 on Windows 10 maybe similar bug right after clicking 'Pull origin'.
I have no other tools/processes contacting my GitHub repo.
This happens for me occasionally with the git commandline too, but it's only transient. A retry is usually successful.
I believe (as @iAmWillShepherd suggested earlier) that one thing that can cause this is some kind of locking issue. My VSCode has a git plugin which periodically checks remote branch status to tell me how far behind my local branch is. If I remove said plugin I no longer get the issue.
never had this issue except 4 days ago, started happening with every commit/pull I have to do, Xcode 15.0, MacOS 14.0, GitHub Desktop Version 3.3.4 (arm64)
For me, on Windows at least, the only fix was to update the commit code of the branch it complains about directly on the .git/packed-refs file. This file contains all remote branches alongside their head commit codes. In this scenario, the code on this file for this branch was out-dated for some reason. So if you take the correct/latest commit code this branch should have and replace the code on that file with this new one, save it, it should work.
i just had the same error message and in my case it was because i had created the local branch as:
git checkout -b origin/dev__xyz
instead of
git checkout -b dev__xyz
maybe this is your case too ?
If you are using a Mac, the filesystem that you are using is CASE-INSENSITIVE, which means branches named ROY and roy will collide.
error: cannot lock ref 'refs/remotes/origin/roy': is at e384be3f30cac223ac5701ee8409abfdc2ebc371 but expected 229e8bd36b91ce41904348c5f9a2a72d6c8cba1e
From https://github.com/NetBSD/src
! 229e8bd36b91..f1b9b4a621fa roy -> origin/roy (unable to update local ref)
This will probably break your brain:
1830][cryo@morbo:~/Desktop/Github/src]$ ls -l .git/refs/remotes/origin/roy
-rw-r--r-- 1 cryo staff 41 Feb 13 18:25 .git/refs/remotes/origin/roy
[1831][cryo@morbo:~/Desktop/Github/src]$ ls -l .git/refs/remotes/origin/ROY
-rw-r--r-- 1 cryo staff 41 Feb 13 18:25 .git/refs/remotes/origin/ROY
[1831][cryo@morbo:~/Desktop/Github/src]$ ls -l .git/refs/remotes/origin/RoY
-rw-r--r-- 1 cryo staff 41 Feb 13 18:25 .git/refs/remotes/origin/RoY
So my theory is that the hash changes based on what the committed put into the tree ... there may be two branches, called ROY and roy, but the filesystem will see them as the same and git will burp.
None of the solutions proposed has worked for me. I had to delete the local copy of the repo and clone it again. Working on a pretty powerful but old Windows laptop.
bugConfirmed bugs or reports that are very likely to be bugspriority-2Bug that affects more than a few users in a meaningful way but doesn't prevent core functions
Activity
zhzoo commentedon Aug 19, 2018
On windows, happens to me nearly every time.
Same exact error as you:
error: cannot lock 'ref/remotes/origin/blahblahblah': is at something but expected somethingelse
Hacky workaround I've been doing is a combination of:
running: git gc --prune=now
and deleteing .git/refs/remote/origin
iAmWillShepherd commentedon Aug 27, 2018
Thanks for taking the time to open an issue! 🙇
This error is often a symptom of more than one process trying to act on the same repository at the same time.
@natros could you verify if you are using other tools to manage your repository while Desktop is open (some IDEs and text editors have git plugins that may access your repository)?
cc @desktop/support
natros commentedon Aug 27, 2018
hi,
i'm not using other tools, just using this to keep up to date with last changes from a few repositories. the one that most often is causing me problems is this repo:
and this happens right now
github desktop 1.3.4
$ git --version
git version 2.18.0
macOS 10.13.6
i'm going to remove the repo and start a new clone to see if what happens in a frew days.
natros commentedon Aug 27, 2018
and btw, this is what i have in my config
zhzoo commentedon Aug 28, 2018
Least for me, the latest update fixed the issue.
But previously, I had tried restarting my computer, killing all relevant processes, etc...
natros commentedon Aug 28, 2018
and it's happening again but this time i'm posting the log from developer tools:
iAmWillShepherd commentedon Aug 29, 2018
I suspect this issue is caused by how we get the status of a repo. #5376 should fix this if your issue is indeed caused by us writing status to disk.
cacho commentedon Aug 30, 2018
Happen from time to time to me too.
I'm using VSCode an iTerm2 with agnoster theme to see the branch currently active.
marek-benes commentedon Sep 17, 2018
I have the same problem on the latest version of MacOS.
jsimmonds2 commentedon Sep 25, 2018
GitHub Desktop Version 1.4.0 on Windows 10 maybe similar bug right after clicking 'Pull origin'.
I have no other tools/processes contacting my GitHub repo.
Comply-it commentedon Sep 26, 2018
I'm experiencing this issue also. Github Desktop 1.40
FernandoHurtado commentedon Oct 10, 2018
Same issue on Arch linux
42 remaining items
bawantha commentedon Sep 12, 2023
Nothing worked for me
abhijeet1033 commentedon Oct 12, 2023
not able to fetch master changes.
trickyearlobe commentedon Oct 26, 2023
This happens for me occasionally with the git commandline too, but it's only transient. A retry is usually successful.
I believe (as @iAmWillShepherd suggested earlier) that one thing that can cause this is some kind of locking issue. My VSCode has a git plugin which periodically checks remote branch status to tell me how far behind my local branch is. If I remove said plugin I no longer get the issue.
h-elbeheiry commentedon Oct 27, 2023
never had this issue except 4 days ago, started happening with every commit/pull I have to do, Xcode 15.0, MacOS 14.0, GitHub Desktop Version 3.3.4 (arm64)
fernandowolff commentedon Dec 13, 2023
For me, on Windows at least, the only fix was to update the commit code of the branch it complains about directly on the .git/packed-refs file. This file contains all remote branches alongside their head commit codes. In this scenario, the code on this file for this branch was out-dated for some reason. So if you take the correct/latest commit code this branch should have and replace the code on that file with this new one, save it, it should work.
ShaliniSekar22 commentedon Feb 15, 2024
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 error: cannot lock ref 'refs/remotes/origin/sha/task': 'refs/remotes/origin/sha' exists; cannot create 'refs/remotes/origin/sha/task'
From https://github.com/Rubix-StyleSpot-NopCommerce/Uzhavar-Nanban ! [new branch] sha/task -> origin/sha/task (unable to update local ref)
c487e0f..9e99de8 uzhavar-dev-deploy -> origin/uzhavar-dev-deploy
error: some local refs could not be updated; try running
'git remote prune https://github.com/Rubix-StyleSpot-NopCommerce/Uzhavar-Nanban.git' to remove any old, conflicting branches
I have this error How can I resolved it.
moro256 commentedon May 19, 2024
if anyone still getting this you can try:
git config remote.origin.prune truena-zi-ya commentedon Jan 2, 2025
same here..
na-zi-ya commentedon Jan 2, 2025
No solution has worked for me.... Can anyone help resolve this issue...?
JohnScalesTR commentedon Jan 14, 2025
7... years... later... still seeing the issue. Tried deleting the origin folder and pruning but nothing works.
frankspies commentedon Jan 16, 2025
i just had the same error message and in my case it was because i had created the local branch as:
git checkout -b origin/dev__xyz
instead of
git checkout -b dev__xyz
maybe this is your case too ?
cryo commentedon Feb 14, 2025
If you are using a Mac, the filesystem that you are using is CASE-INSENSITIVE, which means branches named ROY and roy will collide.
This will probably break your brain:
So my theory is that the hash changes based on what the committed put into the tree ... there may be two branches, called ROY and roy, but the filesystem will see them as the same and git will burp.
iainheng commentedon Apr 11, 2025
I am experiencing this issue only when my Cursor IDE is opened. Close the Cursor IDE and it works again.
gabri-melis commentedon Jun 10, 2025
None of the solutions proposed has worked for me. I had to delete the local copy of the repo and clone it again. Working on a pretty powerful but old Windows laptop.
agrawalmanu16 commentedon Oct 6, 2025
Below command works best in resolving the issues.
git update-ref -d refs/remotes/origin/BRANCH NAME WITH REF ISSUE