How to use git current branch in bash scripts
# Branch is, for example, "main"
export branch=$(git branch --show-current)
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow