class SystemCat::Git
Public Class Methods
checkout(branch)
click to toggle source
# File lib/system_cat/git.rb, line 4 def self.checkout(branch) Shell.run("git checkout #{branch}") end
commit(message, options = {})
click to toggle source
# File lib/system_cat/git.rb, line 8 def self.commit(message, options = {}) command = %(git commit -a -m "#{message}") command << ' --no-verify' if options[:no_verify] Shell.run(command) end
merge(branch)
click to toggle source
# File lib/system_cat/git.rb, line 14 def self.merge(branch) Shell.run("git merge #{branch}") end
pull()
click to toggle source
# File lib/system_cat/git.rb, line 18 def self.pull Shell.run('git pull') end
push(remote, branch)
click to toggle source
# File lib/system_cat/git.rb, line 22 def self.push(remote, branch) Shell.run("git push #{remote} #{branch}") end
stash()
click to toggle source
# File lib/system_cat/git.rb, line 26 def self.stash Shell.run('git stash') end
stash_apply()
click to toggle source
# File lib/system_cat/git.rb, line 30 def self.stash_apply Shell.run('git stash apply') end
status()
click to toggle source
# File lib/system_cat/git.rb, line 34 def self.status result = Shell.run('git status') return { branch: result[/On branch (\S+)/, 1].to_sym, clean: !result[/(nothing to commit, working tree clean)/, 1].nil? } end
tag(tag, remote = :origin, branch = :master)
click to toggle source
# File lib/system_cat/git.rb, line 43 def self.tag(tag, remote = :origin, branch = :master) Shell.run("git tag #{tag} && git push #{remote} #{branch} --tags") end