Git 命令行删除远程分支

查看

git branch -a

删除远程分支

git branch -r -d origin/branch-name
git push origin :branch-name

完整实例

➜  firefly git:(develop) git branch -a
* develop
  master
  test
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/master
  remotes/origin/message-refactor
  remotes/origin/test
  remotes/origin/weixin-pay
➜  firefly git:(develop) git branch -r -d origin/message-refactor 
Deleted remote-tracking branch origin/message-refactor (was a5446a0).
➜  firefly git:(develop) git push origin :message-refactor       
To gitlab.tiantong.com:java/firefly.git
 - [deleted]         message-refactor
➜  firefly git:(develop) git branch -a                           
* develop
  master
  test
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/master
  remotes/origin/test
  remotes/origin/weixin-pay
➜  firefly git:(develop)


未经允许请勿转载:程序喵 » Git 命令行删除远程分支

点  赞 (0) 打  赏
分享到: