Terima kasih kepada Steve dan Neevek, saya menemukan solusi yang bekerja cukup baik untuk saya yang menurut saya layak untuk dibagikan:
Solusi Steve berhasil untuk saya dengan satu penyesuaian kecil. Remote saya diberi nama origin/feature/some-feature-namejadi saya memangkas awk:
git branch -r | awk -Forigin/ '/\/feature/ {print $2 $3}' | xargs -I {} git push origin :{}
Sekarang melakukan aliran penghapusan kecil yang bagus:
To github.com:project/project-name.git
- [deleted] feature/search-min-chars
To github.com:project/project-name.git
- [deleted] feature/search-placeholder
To github.com:project/project-name.git
- [deleted] feature/server-error-message
To github.com:project/project-name.git
- [deleted] feature/six-point-asterisk
Saya bertanya-tanya apakah ada yang punya ide untuk solusi yang lebih elegan, yang mungkin menghasilkan sesuatu seperti ini (skrip CLI saya sangat buruk, jadi saya butuh waktu untuk memikirkannya):
git push origin :feature/search-min-chars :feature/search-placeholder :feature/server-error-message :feature/six-point-asterisk
Ini akan menghasilkan satu keluaran yang bagus dengan satu permintaan jaringan:
To github.com:project/project-name.git
- [deleted] feature/search-min-chars
- [deleted] feature/search-placeholder
- [deleted] feature/server-error-message
- [deleted] feature/six-point-asterisk
$ git branch -r | awk -F/ '/\/APR/{print $2}' | xargs -I {} git push origin :{} error: unable to push to unqualified destination: APR-04-DPH The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on the source ref. error: failed to push some refs to 'GIT_URL'