Это скрипт для удаления ветки после слияния с главной веткой
from git import Repo
repo = Repo.clone_from(SSHURL, newversiontag)
merge = repo.git.merge('origin/'+ newversiontag)
repo.git.push('--set-upstream', 'origin', 'master')
tag = repo.create_tag(newversiontag)
repo.git.push('--set-upstream', 'origin',tag)
repo.delete_head(newversiontag)
Ошибка: это я получаю. Пожалуйста, помогите мне, как удалить указанную c ветку в git используя скрипт
Traceback (most recent call last):
File "Clone.py", line 78, in <module>
repo.delete_head(newversiontag)
File "/home/igs-lt14/.local/lib/python2.7/site-packages/git/repo/base.py", line 394, in delete_head
return Head.delete(self, *heads, **kwargs)
File "/home/igs-lt14/.local/lib/python2.7/site-packages/git/refs/head.py", line 127, in delete
repo.git.branch(flag, *heads)
File "/home/igs-lt14/.local/lib/python2.7/site-packages/git/cmd.py", line 545, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/home/igs-lt14/.local/lib/python2.7/site-packages/git/cmd.py", line 1014, in _call_process
return self.execute(call, **exec_kwargs)
File "/home/igs-lt14/.local/lib/python2.7/site-packages/git/cmd.py", line 825, in execute
raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git branch -d 2.0
stderr: 'error: branch '2.0' not found.'