Module: Pullr::SCM::Git
- Includes:
- CommandLine
- Defined in:
- lib/pullr/scm/git.rb
Instance Method Summary collapse
-
#scm_pull(uri, dest = nil) ⇒ Object
Pulls down a copy of a Git source repository.
-
#scm_update(path, uri = nil) ⇒ Object
Updates a local Git repository.
Methods included from CommandLine
Instance Method Details
#scm_pull(uri, dest = nil) ⇒ Object
Pulls down a copy of a Git source repository.
17 18 19 20 21 22 23 |
# File 'lib/pullr/scm/git.rb', line 17 def scm_pull(uri,dest=nil) if dest sh 'git', 'clone', uri, dest else sh 'git', 'clone', uri end end |
#scm_update(path, uri = nil) ⇒ Object
Updates a local Git repository.
34 35 36 37 38 39 |
# File 'lib/pullr/scm/git.rb', line 34 def scm_update(path,uri=nil) cd(path) do sh 'git', 'reset', '-q', '--hard', 'HEAD' sh 'git', 'pull' end end |