I think there isn't one, simply because git allows forward slashes in branch names. Take a look at git-branch docs to see how the branchname
is defined:
Further more, take a look at the git-check-ref-format docs to understand how can you restrict this, if need be (--allow-onelevel
).
With all that in mind, I think git sees the branch name as a whole, including the slash, so it wouldn't need to provide any specific command to parse it, but you can always pipe the branch name to another tool that will filter it out. For example this SO answer addresses such case. You would probably have to use something like: value=${str#*/}
.