How to use git current branch in bash scripts

# Branch is, for example, "main"
export branch=$(git branch --show-current)