instance method
git
Ruby on Rails 8.0.4
Since v3.0.20Signature
git(commands = {})
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`
Parameters
-
commandsopt = {}
Source
# 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, options|
run "git #{cmd} #{options}"
end
end
end
Defined in railties/lib/rails/generators/actions.rb line 237
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::Actions