diff --git a/developers_chamber/git_utils.py b/developers_chamber/git_utils.py index 6405041..11c0b4d 100644 --- a/developers_chamber/git_utils.py +++ b/developers_chamber/git_utils.py @@ -50,10 +50,15 @@ def create_release(version_file, release_type, remote_name=None, branch_name=Non release_branch_name = "release/v{}".format(f"{version.major}.{version.minor}") else: raise BadParameter("build is not allowed for release") + + branch_names = [branch.name for branch in repo.branches] + if release_branch_name in branch_names: + g.branch("-D", release_branch_name) + g.checkout(branch_name or "HEAD", b=release_branch_name) g.tag(str(version)) if remote_name: - g.push(remote_name, release_branch_name, force=True) + g.push(remote_name, release_branch_name) g.push(remote_name, str(version)) return release_branch_name diff --git a/setup.py b/setup.py index ad37347..13c0031 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='developers-chamber', - version='0.1.2', + version='0.1.3', description='A small plugin which help with development, deployment, git', keywords='django, skripts, easy live, git, bitbucket, Jira', author='Druids team',