-2

我正在尝试通过以下方式删除远程分支

git push origin :dev

但是会出现以下错误:

remote: Updating references: 100% (1/1)
To ssh://user@git.example.com:29400/user/project.git
 ! [remote rejected] dev (branch is currently checked out)
error: failed to push some refs to 'ssh://user@git.example.com:29419/user/project.git'


以下是有关起源的更多详细信息:

git remote show origin
* remote origin
  Fetch URL: ssh://user@git.example.com:29400/user/project.git
  Push  URL: ssh://user@git.example.com:29400/user/project.git
  HEAD branch: dev
  Remote branches:
    dev    tracked
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local refs configured for 'git push':
    dev    pushes to dev    (up to date)
    master pushes to master (up to date)

如何删除这个远程开发分支(不直接访问远程服务器)?

4

2 回答 2

0

开始删除您的本地分支dev。之后,您将能够删除远程的。

git branch -d dev
git push origin :dev
于 2016-05-30T09:18:14.430 回答
0
git push <remote-name> --delete <branch-name>
于 2016-05-30T09:21:06.063 回答