Module: Werk::Git

Included in:
Base
Defined in:
lib/werk/git.rb

Instance Method Summary collapse

Instance Method Details

#repo_branch(new_branch, source_branch = "HEAD", *args) ⇒ Object



7
8
9
10
# File 'lib/werk/git.rb', line 7

def repo_branch(new_branch, source_branch = "HEAD", *args)
  require_clean
  system "git co -b #{new_branch} #{source_branch}"
end

#repo_checkout(new_branch, *args) ⇒ Object



3
4
5
# File 'lib/werk/git.rb', line 3

def repo_checkout(new_branch, *args)
  system "git co #{new_branch}"
end

#repo_current_headObject



27
28
29
# File 'lib/werk/git.rb', line 27

def repo_current_head
  `git symbolic-ref HEAD`.gsub("refs/heads/", "")
end

#repo_merge(from_branch, *args) ⇒ Object



12
13
14
15
# File 'lib/werk/git.rb', line 12

def repo_merge(from_branch, *args)
  require_clean
  system "git merge --no-ff #{from_branch}"
end

#repo_pull(remote = "origin") ⇒ Object



22
23
24
25
# File 'lib/werk/git.rb', line 22

def repo_pull(remote = "origin")
  require_clean
  system "git pull #{remote}"
end

#repo_push(remote = "origin") ⇒ Object



17
18
19
20
# File 'lib/werk/git.rb', line 17

def repo_push(remote = "origin")
  require_clean
  system "git push #{remote} HEAD"
end