I want to write a bash script that scans the branches in my repository, checkout them one by one and fix a typo in every source using sed.
My problem is to make a list of the branches with origin/HEAD filtered out.
branches=$(git branch -r | grep 'origin/^(HEAD)+')
Code inspired by this answer: Regex - Does not contain certain Characters
But I got an empty list in $branches.