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