module Gitag

directly use the module for commanding

Constants

VERSION

Public Class Methods

tag!(dir, tag) click to toggle source
# File lib/gitag.rb, line 6
def self.tag!(dir, tag)
  g = Git.open(dir)
  st = g.status
  sz = st.changed.size + st.added.size + st.deleted.size + st.untracked.size
  return false unless sz > 0

  g.add(:all=>true)
  g.commit("commit new version of backup for #{tag}")
  puts "create new tag: #{tag}"
  g.add_tag(tag)
  g.push if g.remotes.size > 0
end