Transferred from: http://elephantliu.blog.51cto.com/1107116/636967
Once entangled in too many branches on the github.com cause the branch is too chaotic. have been looking for ways to delete the remote branch, but the method found on the internet is not good.
An inadvertent mistake resulted in the deletion of a branch on a github.com project, only to find a way to remove the github.com branch. Hope to be able to help you.
Ideas:
Create a new empty repository and push the empty repository directly to a branch of github.com. This branch will be automatically deleted.
Code:
remote_repo="Https://github.com/lexdene/Dlut-Game-Platform.git" #这是我想删除分支的仓库地址
Remote_branch="Libapi" #这是我想删除的远端仓库分支的名字
Mkdir/tmp/git-empty
Cd/tmp/git-empty
Git init
git push $remote _repo: $remote _branch #有个冒号不能省略
Complete the full text.
# Update
Git branch-d-R $remote _branch
git push remote_name--delete branch_name
This article is from the "Elephant_liu" blog, make sure to keep this source http://elephantliu.blog.51cto.com/1107116/636967
How git Deletes a remote branch