स्टीव और नीवेक के लिए धन्यवाद, मुझे एक समाधान मिला, जिसने मेरे लिए बहुत अच्छा काम किया, जो मुझे साझा करने लायक लगा:
स्टीव के समाधान ने मेरे लिए एक मामूली समायोजन के साथ काम किया। मेरे अवशेषों को नाम दिया गया था origin/feature/some-feature-nameइसलिए मैंने आपकी छंटनी की awk:
git branch -r | awk -Forigin/ '/\/feature/ {print $2 $3}' | xargs -I {} git push origin :{}
अब यह एक अच्छा सा डिलीट फ्लो कर रहा है:
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
सोच रहा था कि क्या किसी को अधिक सुरुचिपूर्ण समाधान के लिए कोई विचार था, हालांकि, यह कुछ इस तरह से उत्पादन कर सकता है (मेरी सीएलआई स्क्रिप्टिंग बहुत खराब है, इसलिए मुझे यह पता लगाने में थोड़ी देर लगेगी):
git push origin :feature/search-min-chars :feature/search-placeholder :feature/server-error-message :feature/six-point-asterisk
यह एक नेटवर्क अनुरोध के साथ एक अच्छा एकल आउटपुट में परिणाम देगा:
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'