def get_branches(local_only=False, directory=None):
    cmd = 'git branch --no-color'
    if not local_only:
        cmd += ' -a'
    out = check_output(cmd, shell=True, cwd=directory)
    branches = []
    for line in out.splitlines():
        if line.count('HEAD -> ') > 0:
            continue
        if line.count('(no branch)') > 0:
            continue
        line = line.strip('*').strip()
        branches.append(line)
    return branches
Returns a list of branches in the git repository.
dataset/ETHPy150Open ros-infrastructure/bloom/bloom/git.py/get_branches