1
替換文本,我有以下腳本我使用刪除混帳合併分支:管道
function Remove-MergedBranches
{
git branch -a --merged |
ForEach-Object { $_.Trim() } |
Where-Object {$_ -NotMatch "^\*"} |
Where-Object {-not ($_ -Like "*master")} |
Where-Object {-not ($_ -Like "*develop")} |
Where-Object {-not ($_ -Like "*dev")} |
% {$_.replace("/remotes","")} |
ForEach-Object { git branch -d $_ }
}
的replace
不工作。
一個分支可能是remotes/origin/tg-training-section