Reputation: 347
So I have multiple local branches (i.e. "TEST-001, TEST-002, TEST-003, etc...") I was wondering how to delete all local branches that contain the keyword "TEST".
So here's what I got so far.
git branch | grep "TEST" # ->> WORKS
git branch -d | grep "TEST" # ->> FAILS
Upvotes: 1
Views: 705
Reputation: 2208
for branches in `git branch | grep TEST`;
do git branch -D $branches;
done
try this..
Upvotes: 0