Sha256: 296f48b961eda82ae0ffc9ab53cd9aa2416f0a31aef2a59a6b4a11521cfb71da

Contents?: true

Size: 661 Bytes

Versions: 26

Compression:

Stored size: 661 Bytes

Contents

#!/usr/bin/env ruby

#prune branches that have been merged into master from the repo
#usage -r --remote to prune remote branches

require File.join(File.dirname(__FILE__), '..', 'lib', 'socialcast-git-extensions.rb')
include Socialcast

remote = ARGV.delete("--remote") || ARGV.delete("-r")

run_cmd "git checkout master"
run_cmd "git pull"

HighLine.say "Deleting <%= color('#{remote ? 'remote' : 'local'}', :green) %> branches that have been merged into master"
branches(:merged => true).each do |branch|
  run_cmd "git branch -d #{branch}"
end

if remote
  branches(:merged => true, :remote => true).each do |branch|
    run_cmd "grb rm #{branch}"
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
socialcast-git-extensions-2.2.1 bin/git-prune-merged
socialcast-git-extensions-2.2.0 bin/git-prune-merged
socialcast-git-extensions-2.1.3 bin/git-prune-merged
socialcast-git-extensions-2.1.2 bin/git-prune-merged
socialcast-git-extensions-2.1.1 bin/git-prune-merged
socialcast-git-extensions-2.1.0 bin/git-prune-merged
socialcast-git-extensions-2.0.8 bin/git-prune-merged
socialcast-git-extensions-2.0.7 bin/git-prune-merged
socialcast-git-extensions-2.0.6 bin/git-prune-merged
socialcast-git-extensions-2.0.5 bin/git-prune-merged
socialcast-git-extensions-2.0.4 bin/git-prune-merged
socialcast-git-extensions-2.0.3 bin/git-prune-merged
socialcast-git-extensions-2.0.2 bin/git-prune-merged
socialcast-git-extensions-2.0.1 bin/git-prune-merged
socialcast-git-extensions-2.0.0 bin/git-prune-merged
socialcast-git-extensions-2.0.0.beta4 bin/git-prune-merged
socialcast-git-extensions-2.0.0.beta3 bin/git-prune-merged
socialcast-git-extensions-2.0.0.beta2 bin/git-prune-merged
socialcast-git-extensions-2.0.0.beta1 bin/git-prune-merged
socialcast-git-extensions-1.5.5 bin/git-prune-merged