I'm pretty sure I saw somewhere in a popular Git project the branches had a pattern like "feature/xyz".
However when I try to create a branch with the slash character, I get an error:
$ git branch labs/feature
error: unable to resolve reference refs/heads/labs/feature: Not a directory
fatal: Failed to lock ref for update: Not a directory
Same problem for (my initial attempt):
$ git checkout -b labs/feature
How does one create a branch in Git with the slash character?
HEAD
. It looks like git thinks yourHEAD
is a link to the branchlabs/feature
which hasn't been created. I've no idea how this could have happened, but it means that your attempt to create a branch calledfoo/bar
based off it, it's not working. Any idea how yourHEAD
came unstuck? – CB Bailey.git/refs/heads
ie if you dogit checkout -b feature/123
then inside yourprojectRootFolder/.git/refs/heads
directory you'll see a directory named:feature
where inside that directory you'll see a branch named123
. Later if you create anotherfeature/124
then inside thefeature
directory, you'll see a branch named124
– Honey