Method: Rails::Generators::Actions#git
- Defined in:
- railties/lib/rails/generators/actions.rb
#git(commands = {}) ⇒ Object
Runs one or more git commands.
git :init
# => runs `git init`
git add: "this.file that.rb"
# => runs `git add this.file that.rb`
git commit: "-m 'First commit'"
# => runs `git commit -m 'First commit'`
git add: "good.rb", rm: "bad.cxx"
# => runs `git add good.rb; git rm bad.cxx`
237 238 239 240 241 242 243 244 245 |
# File 'railties/lib/rails/generators/actions.rb', line 237 def git(commands = {}) if commands.is_a?(Symbol) run "git #{commands}" else commands.each do |cmd, | run "git #{cmd} #{options}" end end end |