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
@arbuzzer It looks like there may be some underlying repository corruption that is causing this issue. Could you go to the file menu in GitHub Desktop and select Repository > Open in <your_default_command_line_application> and run the command git fsck? That should give some some more information about this error. Please share the full output of that command.
@arbuzzer It looks like there may be some underlying repository corruption that is causing this issue. Could you go to the file menu in GitHub Desktop and select Repository > Open in <your_default_command_line_application> and run the command git fsck? That should give some some more information about this error. Please share the full output of that command.
Thanks for sharing that information @arbuzzer. A few other questions:
Based on the screenshot it looks like you are were running those commands in your root directory (i.e. C:\Users\Your_User) -- is that the correct location of this repository, or is it possibly in a different directory? If you are storing this repository in a different location you will need to run Git commands from within that directory that contains your repository.
Is this a repository that you just freshly cloned to your local machine using GitHub Desktop?
It would also be helpful if you could run the following two commands within the repository directory to provide more configuration information about your local repository:
git branch -a git config -l --list
Please let me know the output of both of those commands
Thanks for sharing that information @arbuzzer. A few other questions:
Based on the screenshot it looks like you are were running those commands in your root directory (i.e. C:\Users\Your_User) -- is that the correct location of this repository, or is it possibly in a different directory? If you are storing this repository in a different location you will need to run Git commands from within that directory that contains your repository.
Is this a repository that you just freshly cloned to your local machine using GitHub Desktop?
It would also be helpful if you could run the following two commands within the repository directory to provide more configuration information about your local repository:
git branch -a git config -l --list
Please let me know the output of both of those commands
Thanks for sharing that information @arbuzzer. A few other questions:
Based on the screenshot it looks like you are were running those commands in your root directory (i.e. C:\Users\Your_User) -- is that the correct location of this repository, or is it possibly in a different directory? If you are storing this repository in a different location you will need to run Git commands from within that directory that contains your repository.
Is this a repository that you just freshly cloned to your local machine using GitHub Desktop?
It would also be helpful if you could run the following two commands within the repository directory to provide more configuration information about your local repository:
git branch -a git config -l --list
Please let me know the output of both of those commands
I did all the actions described on the forums again and that's what I did. Expected(Blue Box) and Actual(Red Box) Behavior.
Спасибо @arbuzzer . Попробуйте запустить команду, git fetch --allчтобы origin/masterснова захватить удаленную ветку. Это, надо надеяться, исправить эту проблему.
Reacted by Bohdan Sych, Bervianto Leo Pratama, Lumax, mkk, Paul Bogere, David, Larry Witzel, Chirag Shah, Huang DongJiang, Cynthia Emerenini and 2 more
Reacted by mkk, Huang DongJiang and Thorsten Hans
Reacted by Francis, Vicky Gonsalves, briancalma, Richard Abraham, ankitdangayach, Aishwarya Laxmi, hadarkam, zuez2718, Vladyslav Bihun, Mark Carcillar and 5 more
@arbuzzer sorry about that -- you will need to run del .git/refs/remotes/origin/master since you are using the command prompt.
Maybe it will help me to reinstall the system, or is it easier for me to create a new account? It is just important for me to use this application.
If you would like you can also perform a fresh clone of the repository to GitHub Desktop -- a fresh clone will not have the issues you are encountering.
I had a similar issue running VSCode on Windows 10 and trying to commit changes or push. However what solved it for me was changing my controlled folder access in Windows settings which was preventing git from creating the .lock files locally.
None of the previous methods worked for me, so what I did was make a copy of the folder, delete the folder, go to GitHub Desktop, clone the repository, paste the files that I had modified that I couldn't upload and that's it.
Reacted by Nikhil Verma and Peter Jan Simons Merino
Activity
[-]Error: Cannot lock ref ...[/-][+]Error: Cannot lock ref 'refs/remotes/origin/master'[/+]billygriffin commentedon Nov 7, 2018
Hi @arbuzzer, thanks for the report and sorry you're having issues.
We ask that folks fill out the template so we can better understand your setup and what's going on so we make the best use of the maintainers' time. Here's the template you need: https://github.com/desktop/desktop/issues/new?template=bug_report.md
Thanks for understanding and meeting us halfway! 😄
steveward commentedon Nov 7, 2018
@arbuzzer It looks like there may be some underlying repository corruption that is causing this issue. Could you go to the file menu in GitHub Desktop and select
Repository>Open in <your_default_command_line_application>and run the commandgit fsck? That should give some some more information about this error. Please share the full output of that command.arbuzzer commentedon Nov 7, 2018
arbuzzer commentedon Nov 7, 2018
Description
error: cannot lock ref 'refs/remotes/origin/master': unable to resolve reference
'refs/remotes/origin/master': reference broken
From https://github.com/arbuzzer/arbuzzer.github.io
! [new branch] master -> origin/master (unable to update local ref)
Version
*GitHub Desktop:

*Operating system:

Steps to Reproduce
Expected(Blue Box) and Actual(Red Box) Behavior
3.
And so with every command that people offer.
Additional Information
Profile-20181107T180828.zip
Logs
2018-11-07.desktop.production.log
2018-10-03.desktop.production.log
2018-10-02.desktop.production.log
2018-09-11.desktop.production.log
2018-09-10.desktop.production.log
2018-09-07.desktop.production.log
2018-09-05.desktop.production.log
2018-09-04.desktop.production.log
2018-09-03.desktop.production.log
2018-09-01.desktop.production.log
steveward commentedon Nov 7, 2018
Thanks for sharing that information @arbuzzer. A few other questions:
It would also be helpful if you could run the following two commands within the repository directory to provide more configuration information about your local repository:
git branch -agit config -l --listPlease let me know the output of both of those commands
arbuzzer commentedon Nov 7, 2018
arbuzzer commentedon Nov 7, 2018
I did all the actions described on the forums again and that's what I did. Expected(Blue Box) and Actual(Red Box) Behavior.
steveward commentedon Nov 7, 2018
Thanks @arbuzzer. Try running the command
git fetch --allto grab the remoteorigin/masterbranch again. That should hopefully fix this issue.arbuzzer commentedon Nov 8, 2018
arbuzzer commentedon Nov 8, 2018
Maybe it will help me to reinstall the system, or is it easier for me to create a new account? It is just important for me to use this application.
steveward commentedon Nov 8, 2018
@arbuzzer apologies -- I think we need to clean things up before running that command. Try these steps:
rm .git/refs/remotes/origin/mastergit fetchgit branch --set-upstream-to=origin/masterLet me know if that doesn't get things working.
arbuzzer commentedon Nov 8, 2018
It doesn't work :(

steveward commentedon Nov 8, 2018
@arbuzzer sorry about that -- you will need to run
del .git/refs/remotes/origin/mastersince you are using the command prompt.If you would like you can also perform a fresh clone of the repository to GitHub Desktop -- a fresh clone will not have the issues you are encountering.
6 remaining items
Ngwind commentedon Mar 30, 2019
nice!this solved my problem
arpitgupta19 commentedon Jun 6, 2019
This worked for me :
git remote prune origin
xiye520 commentedon Dec 4, 2019
git remote prune origin
This worked for me too!
donprecious commentedon Jan 31, 2020
Try
cleaning-up your local repository with:
sugoireed commentedon Mar 4, 2020
After searching constantly, this is the solution that worked for me which entails unsetting/removing the Upstream
briancalma commentedon Apr 17, 2020
It worked like a charm! Thanks
richierich25 commentedon Apr 29, 2020
rm .git/refs/remotes/origin/master
git fetch
git branch --set-upstream-to=origin/master
--> This worked for me magically.
Dzone1658 commentedon May 11, 2020
git fetch --all
git branch --set-upstream-to=origin/master
/* This one works for me */
thanks a lot.
rishabh-mmc commentedon Jul 2, 2020
@richierich25 worked for me too
thanks
BellatrixLeStranger commentedon Jul 4, 2020
I had a similar issue running VSCode on Windows 10 and trying to commit changes or push. However what solved it for me was changing my controlled folder access in Windows settings which was preventing git from creating the .lock files locally.
mkkmail commentedon Dec 14, 2020
This worked for me. Thanks!
PETEROLO291 commentedon Jan 26, 2021
None of the previous methods worked for me, so what I did was make a copy of the folder, delete the folder, go to GitHub Desktop, clone the repository, paste the files that I had modified that I couldn't upload and that's it.
AshutoshSajan commentedon Sep 21, 2021
thank you
CopyBug commentedon Oct 21, 2021