remove a remote branch (push origin ':' ) with gitpython
问题 I cannot find a way to perform a commend equivalent to: git push origin :branchName A command that delete a remote branch, can gitpython perform this using git push? Thanks 回答1: I found the solution by myself, it is something like this: # repo is a local repository previously checked-out remote = repo.remote(name='origin') remote.push(refspec=(':delete_me')) 回答2: I was struggling with this as well so I'm posting this here for future posterity. One thing that I was missing was the need to