Module: Stool::Git_util

Included in:
LibInfo, TaskInfo
Defined in:
lib/stool/Core/Git.rb

Instance Method Summary collapse

Instance Method Details

#git_checkout(file) ⇒ Object



43
44
45
# File 'lib/stool/Core/Git.rb', line 43

def git_checkout(file)
  `git checkout #{file}`
end

#git_commit_all(msg) ⇒ Object

提交



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/stool/Core/Git.rb', line 23

def git_commit_all(msg)

  `git diff`

  puts "--- 提交所有变更代码"
  `git add .`

  unless msg
    msg = 'stool - auto commit'
  end

  `git commit -m"#{msg}"`
end

#git_stObject

状态



7
8
9
10
# File 'lib/stool/Core/Git.rb', line 7

def git_st
  puts "--- git status"
  `git status`
end

#git_stashObject



12
13
14
15
# File 'lib/stool/Core/Git.rb', line 12

def git_stash
  puts "--- git stash"
  `git stash`
end

#git_stash_popObject



17
18
19
20
# File 'lib/stool/Core/Git.rb', line 17

def git_stash_pop
  puts '--- git stash pop'
  `git stash pop`
end

#git_upObject

update



38
39
40
41
# File 'lib/stool/Core/Git.rb', line 38

def git_up
  puts "--- git update"
  `git pull`
end