Add to Favorites

fatal: update_ref failed for ref 'HEAD'

Looks like the last commit on Atlassian Sourcetree crashed and I have a file corrupted in the process. Here's my troubleshooting steps:

1. Fine out what caused crash - see previous post

fatal: update_ref failed for ref 'HEAD': cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/hotfix/admin_interface_updates': reference broken
Completed with errors, see above.

https://stackoverflow.com/questions/39057962/git-cannot-lock-ref-head-unable-to-resolve-reference-head

command:

git reset

Than I removed file /my_project_directory/./git/refs/heads/master and than I can use command

git reset --hard <my_hash_of_last_commit_on_remote_branch>

Comments

Be the first to leave a comment on this post.

Leave a comment

To leave a comment, please log in / sign up