Powershell代码段
$change=git ls-remote origin "refs/changes/*/*/*"
$change|ForEach-Object{
$refs=$_.Substring($_.LastIndexOf("changes"),$_.Length-$_.LastIndexOf("changes"));
git branch -r -d origin/$refs;
本文介绍了一段Powershell脚本,该脚本用于自动化清理Git远程仓库中特定格式的分支。通过使用`gitls-remote`和正则表达式匹配目标分支,再利用`ForEach-Object`循环来删除对应的远程分支。
Powershell代码段
$change=git ls-remote origin "refs/changes/*/*/*"
$change|ForEach-Object{
$refs=$_.Substring($_.LastIndexOf("changes"),$_.Length-$_.LastIndexOf("changes"));
git branch -r -d origin/$refs;

被折叠的 条评论
为什么被折叠?
