Can anyone who knows git help me with this problem? I don't know git very well at all (or understand it for that matter) but I've been using it for the past few months in the most basic way possible. I usually don't get errors. Now I can't update my repository because I am getting the following error.

error: update_ref failed for ref 'refs/remotes/origin/master': cannot lock ref 'refs/remotes/origin/master': unable to resolve reference 'refs/remotes/origin/master': reference broken

Does anybody know why this happened and how to fix it?
Did you change your username and / or email?

rm .git/refs/remotes/origin
git fetch --all
No, I didn't change my username. I tried some of the various fixes I found online, like remote prune and so on. Eventually I just went into the .git folder and deleted the file it couldn't lock on (refs/remotes/origin/master).

Now that I've done that, I'm not getting errors anymore, and the repository is updating. The messages don't look the same as they did before, which concerns me a little bit. For instance, I got this when adding an updated file

warning: LF will be replaced by CRLF in scripts/world.js.
The file will have its original line endings in your working directory.

Will that make a difference?
Um, if you notice in my post I told you exactly how to solve the issue... but nice on figuring it out Smile

Rather than adding a '\r', it will add a '\r\n' to the newlines in files. That only matters depending on your text editor, otherwise it doesn't matter. If everything looks okay, there's no issue.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum