code: def create_branch(version):
      
      repo = Repo.init(".")
      if repo.is_dirty(untracked_files=True):
          raise RuntimeError(f"Repository is dirty, please commit/stash your changes.")
  
      branch_name = f"release-{version}"
      print(f"{Fore.CYAN}Create {branch_name} branch from upstream master")
      upstream = get_upstream(repo)
      upstream.fetch()
      release_branch = repo.create_head(branch_name, upstream.refs.master, force=True)
      release_branch.checkout()
      return repo
docs: Create a fresh branch from upstream/master