Thread (2 messages) flat view 2 messages, 2 authors, 2021-07-09

git checkout -b refs/master origin/master

From: Martin <hidden>
Date: 2021-07-09 12:48:34

Just curious..

"refs/master" is allowed as local branch name (git checkout / git branch 
/ git switch)

Is that intentionally allowed?

  git for-each-ref
6faf346455d0a024cb1edf2d64fc4c42b450c53d commit refs/heads/refs/master

  git for-each-ref --format="ref=%(refname)"
ref=refs/heads/refs/master

Especially the effect on
git for-each-ref --format="ref=%(refname:lstrip=-1)"
master

You only get part of the branch name.
Because "lstrip" does not distinguish between the / as separator in the 
refs, and the "/" as part of the name.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help