Class: GitUntil
- Inherits:
-
Object
- Object
- GitUntil
- Defined in:
- lib/git_until.rb
Class Method Summary collapse
-
.git_push(path, commit) ⇒ Object
推送文件.
-
.last_commit_id(path) ⇒ Object
获取最后一次提交commit id.
Class Method Details
.git_push(path, commit) ⇒ Object
推送文件
3 4 5 6 7 |
# File 'lib/git_until.rb', line 3 def self.git_push(path,commit) pn = Pathname.new(path) Dir.chdir(pn.to_s) `git add . && git commit -m "#{commit}" && git pull && git push` end |
.last_commit_id(path) ⇒ Object
获取最后一次提交commit id
10 11 12 13 |
# File 'lib/git_until.rb', line 10 def self.last_commit_id(path) Dir.chdir(path) `git rev-parse --short HEAD`.chomp end |