【Git】当在Git分支中加入了符号“&”后,就无法进行删除的情况
這個問題是什麼?
如果在Git分支上创建了类似以下的分支名称,则无法删除。
例如) feature/add_view&controller
$ git push origin --delete feature/add_view&controller
[1] 19856
zsh: command not found: controller
error: unable to delete 'feature/add_view': remote ref does not exist
error: failed to push some refs to 'https://github.com/~'
[1] + exit 1 git push origin --delete feature/add_view
看起来当有”&”时,”&”后面的分支名(controller)被视为bash命令。
解决办法
只需将其用双引号括起来,即可删除。
git branch -d "feature/add_view&controller"
git push origin --delete fix/authentication