Skip to content

Commit

Permalink
Filter out HEAD when removing remote branches
Browse files Browse the repository at this point in the history
mhartl committed Jun 29, 2023
1 parent 9df3e5d commit 43b26b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/git-cleanup
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ if File.exist?(preserved_file)
preserved += '|' + additional_preserved.join('|')
end
end
cmd = %(git branch --merged | grep -v "\*" | egrep -v "(#{preserved})" | )
cmd = %(git branch --merged | grep -v "\*" | egrep -v "(#{preserved}|HEAD)" | )
if options[:remote]
cmd += "sed -e 's/origin\\//:/' | xargs git push origin"
cmd.sub!('git branch', 'git branch -r')

0 comments on commit 43b26b8

Please sign in to comment.