This one
git checkout -b #1-my-awesome-feature
creates error
error: switch `b' requires a value
escaping it with backslash or wrapping it in quotes will work
git checkout -b \#1-my-awesome-feature
but strange enough this
git branch #1-my-awesome-feature
will not produce any error and if you check if it is created with
git branch --all
there is no branch.
If hash char is not in the first position of the branch name, branch will be created.
git branch feature-#1
Executing git branch
feature-#1
* master
So my question is how hash (#) char is 'translated' in terminal and why it is not working when it is at first place?
Thanks!
#
will not start a comment in cases like above where the#
is not preceded by a space character. Sogit branch feature-#1
works in PowerShell, butgit branch #1-my-awesome-feature
does not (need to escape the#
with a backtick, or put full name in quotes).