To display only the name of the current branch you’re on:
git rev-parse --abbrev-ref HEAD
Reference: Show just the current branch in Git
To display only the name of the current branch you’re on:
git rev-parse --abbrev-ref HEAD
Reference: Show just the current branch in Git