Skip to content

Instantly share code, notes, and snippets.

@pedronsouza
Created February 6, 2013 14:41
Show Gist options
  • Save pedronsouza/4722937 to your computer and use it in GitHub Desktop.
Save pedronsouza/4722937 to your computer and use it in GitHub Desktop.
A little rake task for automate my routine of Commit all
namespace :git do
task :sent, :message, :repo do |t, args|
if args[:message].nil?
puts "You must define a message for the commit, example => rake git:commit['MyMessage']".colored.red
else
puts "Adding files, Commiting and pushing..".colored.yellow
exec("git add . && git add -u && git commit -m '#{args[:message]}' && git push #{args[:repo]}")
puts "All files sent to remote repository: #{:repo}".colored.green
end
end
end
# usage: rake git:sent['message', 'remote']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment