i have an git repo in gitlab. And i tried to switch the branch with the following instructions. And i got the following error OSError: Reference at 'refs/heads/past_branch' does already exist, pointing to '.......', requested was '......' Where is my issue?
repo = Repo(self.rorepo.working_tree_dir)
# Reset our working tree 10 commits into the past
past_branch = repo.create_head('past_branch', 'HEAD~10')
self.assertRaises(git.GitCommandError, repo.heads.master.checkout)
repo.heads.past_branch.checkout()