Module: Prick::Git::Branch
- Defined in:
- lib/prick/local/git.rb
Class Method Summary collapse
- .checkout(branch) ⇒ Object
- .create(branch, id = nil, set_upstream: true) ⇒ Object
- .current ⇒ Object
- .drop(branch) ⇒ Object
- .exist?(branch) ⇒ Boolean
- .list ⇒ Object
Class Method Details
.checkout(branch) ⇒ Object
147 148 149 |
# File 'lib/prick/local/git.rb', line 147 def self.checkout(branch) Command.command "git checkout --quiet #{branch}" end |
.create(branch, id = nil, set_upstream: true) ⇒ Object
122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/prick/local/git.rb', line 122 def self.create(branch, id = nil, set_upstream: true) if set_upstream current = Git.branch.current Command.command %( git checkout --quiet -b #{branch} #{id} git push --quiet --set-upstream origin #{branch} git checkout --quiet #{current} ) else Command.command "git branch #{branch} #{id}" end end |
.current ⇒ Object
143 144 145 |
# File 'lib/prick/local/git.rb', line 143 def self.current() Command.command("git branch --show-current").first end |
.drop(branch) ⇒ Object
135 136 137 |
# File 'lib/prick/local/git.rb', line 135 def self.drop(branch) Command.command "git branch -D #{branch}" end |