Sha256: 15c260a6fb87b8ec71be9e5f328dbf66d6696c12e57476e375641f681c43ec6f

Contents?: true

Size: 691 Bytes

Versions: 7

Compression:

Stored size: 691 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::Gitx
include Socialcast::Git

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

7 entries across 7 versions & 1 rubygems

Version Path
socialcast-git-extensions-2.2.8 bin/git-prune-merged
socialcast-git-extensions-2.2.7 bin/git-prune-merged
socialcast-git-extensions-2.2.6 bin/git-prune-merged
socialcast-git-extensions-2.2.5 bin/git-prune-merged
socialcast-git-extensions-2.2.4 bin/git-prune-merged
socialcast-git-extensions-2.2.3 bin/git-prune-merged
socialcast-git-extensions-2.2.2 bin/git-prune-merged