#NEWLINE# def create_branch( self , repo , base_branch , new_branch ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ref = repo . get_git_ref ( '/' . join ( [ 'heads' , base_branch ] ) ) #NEWLINE# repo . create_git_ref ( ref = ( 'refs/heads/' + new_branch ) , sha = ref . object . sha ) #NEWLINE# #UNINDENT# except GithubException : #NEWLINE# #INDENT# raise BranchExistsError ( 'The branch {} already exists on {}' . format ( new_branch , repo . full_name ) )