【问题标题】:Delete remote branch with bracket name删除带有括号名称的远程分支
【发布时间】:2023-02-20 23:33:54
【问题描述】:

我有一个名为qa(old_ui) 的远程分支。我在本地没有。 我使用了命令

git push origin --delete qa(old_ui)

但没有运气。我认为这是因为括号。

错误是"The term 'old_ui' is not recognized as the name of a cmdlet, function, script file, or operable program.

顺便说一句,我想使用纯 git 命令来完成此操作。

【问题讨论】:

  • 错误消息表明您正在 PowerShell 中执行此操作。像这样引用名字几乎总是一个好主意,你试过--delete "qa(old_ui)"了吗?
  • 我使用了 powershell 但没有工作。错误是fatal: not a git respository...
  • @您好,您执行此命令时似乎位于错误的目录中。您必须在远程存储库的本地克隆中才能执行命令。
  • @knittl,我不确定。我将分支签出到本地并运行命令。同样的错误
  • @Hello cd 在调用推送之前进入克隆目录:git clone git.server.fqdn/path/to/HelloRepo.git; cd HelloRepo; git push origin --delete 'qa(old_ui)'

标签: git powershell


【解决方案1】:

感谢大家的 cmets。单引号似乎在正确的目录中有效。

git push origin --delete 'qa(old_ui)'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-07-08
    • 1970-01-01
    • 2013-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    相关资源
    最近更新 更多