I would try one of the following:
1.> git symbolic-ref --short HEAD
git symbolic-ref --short HEAD>>> sid-dev
git branch --show-current>>> sid-dev
3.> git name-rev –name-only HEAD
git name-rev –name-only HEAD>>> HEAD sid-dev
Notes:
1.> git symbolic-ref --short HEAD displays the short symbolic reference to the current branch’s HEAD. This is the current branch name.
2.> git branch --show-current is also a simple and efficient way to print the current branch name.
3.> git name-rev –name-only HEAD gives the symbolic name for
HEAD
revision of the current branch
4.> In the above examples,
sid-dev
is the name of my branch.