Last active
September 27, 2024 15:51
-
-
Save lordlycastle/e7db769f104aa2eac258811793e151dd to your computer and use it in GitHub Desktop.
When you get update_ref failed for ref error in git.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rename from 'C:/Users/Repos/phishfoodvr/.git/refs/remotes/origin/CHA/main.lock' to 'C:/Users/Repos/phishfoodvr/.git/refs/remotes/origin/CHA/main' failed. Should I try again? (y/n) n | |
# error: update_ref failed for ref 'refs/remotes/origin/CHA/main': couldn't set 'refs/remotes/origin/CHA/main' | |
$ cd $(git rev-parse --show-toplevel) # if necessary | |
$ rm -rf .git/refs/remotes/origin # remove all origin/* | |
$ mkdir .git/refs/remotes/origin # create empty origin/ | |
$ git fetch origin # repopulate origin/* |
Worked like a charm.
It works!
worked clean 💯
Cool, saved my time.
It worked, Thanks for such an amazing solution
You guys are so kind! I'm happy it was useful for others as that was the motivation behind adding these gists.
life saver! thanks!
thank you so much!!!!!!!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wish I had money to send you a PIX.
Thank you 😍!