i need an explanation or example python code to check does an branch exist. My repo is stored in an GitLab enviorement. I addded an GitLabVariable as an substitute of the Branchname.
branches = git.Git().branch("--all").split()
if os.environ.get('GitLabVariable') in branches: