[Solved] error: cannot lock ref ‘refs/remotes/origin/[branch]’

error: cannot lock ref ‘refs/remotes/origin/[branch]’   is *** but     expect ****

#Update the reference first

git update-ref -d refs/remotes/origin/[locked branch name]

#Then synchronize the code git pull


Given two parameters, storing <newvalue> in <ref> may dereference the symbol reference. For example, git update-ref HEAD <newvalue>update the current branch head to a new object.

Given three parameters, after verifying that the current value of <ref> matches <oldvalue>, store <newvalue> in <ref>, which may dereference the symbol reference. For example git update-ref refs/heads/master <newvalue> <oldvalue>, only when its current value is <oldvalue>, will the main branch head be updated to <newvalue>. You can specify 40 “0” or an empty string as <oldvalue> to ensure that the reference you create does not exist.

It also allows the “ref” file to become a symbol pointer to another ref file by starting from the four-byte header sequence of “ref:”.

More importantly, it allows updates of ref files to follow these symbol pointers, whether they are symbolic links or these “regular file symbol references”. It only follows true symbolic links when it starts with “refs/” : otherwise it will only try to read them and update them to regular files (ie, it will allow the file system to follow them, but will override such symbolic links to A normal file name elsewhere).

If –no-deref is given, the <ref> itself is overwritten instead of following the result of the symbol pointer.


Similar Posts: