2011-03-25 4 views
3

Possible en double:
Deleting a badly named git branchGit - comment supprimer une branche?

Je créé une branche par erreur qui commence par un tiret -, un caractère de départ. Par exemple

git checkout -b -z/username/workname origin 

si je tente de supprimer la branche en utilisant git

git branch -D -z/username/workname 

est lancer une erreur d'analyse

error: unknown switch `z' usage: git 
branch [options] [-r | -a] [--merged | 
--no-merged] or: git branch [options] [-l] [-f] <branchname> 
[<start-point>] or: git branch 
[options] [-r] (-d | -D) <branchname> 
or: git branch [options] (-m | -M) [<oldbranch>] <newbranch> 

Comment puis-je supprimer une branche?

+0

double très possible (http://stackoverflow.com/questions/1192180/deleting-a-badly-named-git-branch) [Suppression d'une branche git mal nommé] – Snowbear

Répondre

0

Essayez ceci:

git update-ref -d refs/heads/-z/username/workname 
0

Vous pouvez supprimer la branche avec:

git branch -D /-z/username/workname 
7

Utilisez - pour séparer les -args des args non au tableau de bord. IE:

git branch -D -- -z/username/workname 
Questions connexes