We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ea2422 commit 16ff76aCopy full SHA for 16ff76a
git-prune-remote-branch
@@ -7,11 +7,11 @@ opts.parse!
7
8
`git branch -r`.each_line do |branch|
9
branch.strip!.chomp!
10
- next if branch =~ /[^\/]+\/master/
11
- next if branch =~ /[^\/]+\/develop/
+ next if branch =~ %r![^/]+/master!
+ next if branch =~ %r![^/]+/develop!
12
13
if `git branch --contains #{branch}`.each_line.any? { |included| included.strip.chomp =~ /\A(develop|master)\z/ }
14
- ref = branch.sub(/^(?<remote>[^\/]+)\//, '')
+ ref = branch.sub(%r!^(?<remote>[^/]+)/!, '')
15
command = "git push --delete #{$~[:remote]} #{ref}"
16
puts command
17
unless $noop
0 commit comments