【问题标题】:How to remove old local Git branches on Windows?如何在 Windows 上删除旧的本地 Git 分支?
【发布时间】:2019-09-24 07:20:09
【问题描述】:

我想删除所有不需要的本地 Git 分支,但 this guide 我发现在线使用 Bash。什么是更 Windows 原生的方法?

【问题讨论】:

    标签: git powershell


    【解决方案1】:

    使用 select-string as a replacement for grepPowerShell xargs replacement 这对我有用

    ,@( git branch -vv | select-string -Pattern 'origin/.*: gone]' | %{$_.toString().split(' ')[2].trim()} ) | %{&"git" "branch" "-d" $_}
    

    【讨论】:

      猜你喜欢
      • 2021-12-22
      • 2011-01-01
      相关资源
      最近更新 更多