Created
June 23, 2022 17:00
-
-
Save Reta110/0c7bda8d752dda4424f22e15f9556a2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Watch the remote braches to look the list that we are going to delete: | |
git branch -r | sed 's/origin\/\(.*\)/\1/g' | cut -c 3- | grep -E 'fix_*' //->fix_ is the word to filter | |
RESULT: | |
fix_01032022_2 | |
fix_01042022 | |
fix_01042022_1 | |
fix_01042022_2 | |
#Deleting all of them: | |
git push origin -d `git branch -r | sed 's/origin\/\(.*\)/\1/g' | cut -c 3- | grep -E 'fix_*'` //->fix_ is the word to filter | |
RESULT: | |
- [deleted] fix_01032022_2 | |
- [deleted] fix_01042022 | |
- [deleted] fix_01042022_1 | |
- [deleted] fix_01042022_2 | |
NOTE: | |
This code is for substr the string: | |
| sed 's/origin\/\(.*\)/\1/g' | cut -c 3- | | |
Resutl: "origin/name_of_the_branch" -> "name_of_the_branch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment