Skip to content

Instantly share code, notes, and snippets.

@bunnymatic
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bunnymatic/7a183c70a9a4c84a6815 to your computer and use it in GitHub Desktop.
Save bunnymatic/7a183c70a9a4c84a6815 to your computer and use it in GitHub Desktop.
git bumper playtime
source "https://rubygems.org"
gem 'git'
#!/usr/bin/env ruby
require 'git'
tag = "git-bumper-was-here-#{Time.now.to_i}"
dirs = begin
if ARGV.length > 0
ARGV
else
Dir.glob(File.join("/projects", "*"))
end
end
dirs.each do |dir|
begin
g = Git.open(dir)
puts "DIR", dir
g.add_tag tag, "HEAD"
g.push 'origin', tag
rescue ArgumentError => ex
# not a git dir
puts "Not a valid git dir", ex
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment