This is a really quick question: what is the character encoding used in symbolic ref files like .git/HEAD, especially on Windows?
Is it the same as the filesystem's encoding? It sounds improbable, though, since I've heard before that Windows' filesystem encoding is UTF-16 and ASCII control bytes 0x00..0x1F and 0x7F is prohibited in Git ref name (we can't have a byte 0x00 in Git ref). Is it UTF-8 universally? However it does not seem to be documented in git help check-ref-format. Maybe it lies somewhere else? Or is symbolic ref's encoding undefined? However then, how can we clone, push and fetch branches between each other?
git symbolic-refinstead. Use whatever encodinggit symbolic-refuses as its input and output, and don't worry about what encoding might appear in a Git internal file, because that encoding might change tomorrow.HEAD, handled bygit cloneandgit remote set-head, in an undocumented fashion (it's full of historical oddities, nobody wants to describe them in anything official :-) ). Don't try to transfer symbolic refs from one repository to another; it doesn't work in general.git symbolic-refto poke around andgit update-refto mess with references.HEADitself, in favor of a real (if somewhat oddly encoded) refs database.