1:cmd代码,可以保存到文件。
2:代码内容
%待删除的远程分支% set deleteRemoteBranch=wulingming-develop set work_path=%~dp0 echo 请谨慎检查!!!即将删除当前目录下所有远程分支,当前目录: %% %work_path% %% 即将删除远程分支 %% %deleteRemoteBranch% pause cd /d %work_path% cd %work_path% for /d %%s in (%work_path%\*) do ( cd %%s echo 删除分支 %% %%s %% %deleteRemoteBranch% git push origin --delete %deleteRemoteBranch% ) echo 执行完毕 pause
3:执行结果