Class: Gitmine::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/gitmine/git.rb

Class Method Summary collapse

Class Method Details

.checkout(branch) ⇒ Object



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

def checkout(branch)
  run_cmd("git checkout #{branch}")
end

.delete_remote_branch(branch) ⇒ Object



34
35
36
# File 'lib/gitmine/git.rb', line 34

def delete_remote_branch(branch)
  run_cmd("git push origin :#{branch}")
end

.fetchObject

Run ‘git fetch’



14
15
16
# File 'lib/gitmine/git.rb', line 14

def fetch
  run_cmd("git fetch")
end

.local_branchesObject

Return output of ‘git branch’



4
5
6
# File 'lib/gitmine/git.rb', line 4

def local_branches
  `git branch`
end

.merge(branch) ⇒ Object



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

def merge(branch)
  run_cmd("git merge #{branch}")
end

.pullObject



30
31
32
# File 'lib/gitmine/git.rb', line 30

def pull
  run_cmd("git pull")
end

.pushObject



26
27
28
# File 'lib/gitmine/git.rb', line 26

def push
  run_cmd("git push")
end

.remote_branchesObject

Return output of ‘git branch -r’



9
10
11
# File 'lib/gitmine/git.rb', line 9

def remote_branches
  `git branch -r`
end