Class: Gitmine::Git
- Inherits:
-
Object
- Object
- Gitmine::Git
- Defined in:
- lib/gitmine/git.rb
Class Method Summary collapse
- .checkout(branch) ⇒ Object
- .delete_remote_branch(branch) ⇒ Object
-
.fetch ⇒ Object
Run ‘git fetch’.
-
.local_branches ⇒ Object
Return output of ‘git branch’.
- .merge(branch) ⇒ Object
- .pull ⇒ Object
- .push ⇒ Object
-
.remote_branches ⇒ Object
Return output of ‘git branch -r’.
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 |
.fetch ⇒ Object
Run ‘git fetch’
14 15 16 |
# File 'lib/gitmine/git.rb', line 14 def fetch run_cmd("git fetch") end |
.local_branches ⇒ Object
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 |
.pull ⇒ Object
30 31 32 |
# File 'lib/gitmine/git.rb', line 30 def pull run_cmd("git pull") end |
.push ⇒ Object
26 27 28 |
# File 'lib/gitmine/git.rb', line 26 def push run_cmd("git push") end |
.remote_branches ⇒ Object
Return output of ‘git branch -r’
9 10 11 |
# File 'lib/gitmine/git.rb', line 9 def remote_branches `git branch -r` end |