module Git

Git module to performe git operations

Public Instance Methods

add(files = '.') click to toggle source
# File lib/jekyll_theme_marketing/git.rb, line 7
def add(files = '.')
  system "git add #{files}"
end
checkout_new_branch(name) click to toggle source
# File lib/jekyll_theme_marketing/git.rb, line 11
def checkout_new_branch(name)
  system 'git checkout master'
  system 'git pull origin master'
  system "git checkout #{name}"    # if the branch doesn't exist, create it
  system "git checkout -b #{name}" # if the branch does exist, switch to it
end
list_commits(old, new, options = '') click to toggle source
# File lib/jekyll_theme_marketing/git.rb, line 18
def list_commits(old, new, options = '')
  `git log #{options} #{old}..#{new}`
end
push(remote = '', branch = '', options = '') click to toggle source
# File lib/jekyll_theme_marketing/git.rb, line 22
def push(remote = '', branch = '', options = '')
  system "git push #{options} #{remote} #{branch}"
end