i have an git repo in gitlab. I tried to checkout the master branch with the following lines.
repo = git.Repo(os.path.dirname(__file__), search_parent_directories=True) repo.git.checkout("master") ref_repo_root = os.path.join(WORKING_DIRECTORY, 'ref_decoders') But i got the following error.
E git.exc.GitCommandError: Cmd('git') failed due to: exit code(1) E cmdline: git checkout master E stderr: 'error: pathspec 'master' did not match any file(s) known to git.' What i know repo.git.checkout("HEAD~1") works fine. Where is my issue?
master? That isn't exactly guaranteed any more - for political reasons, some hosting services arrange things (or give you setup steps to arrange things) to name the primary branch something else.git branch -a.