Git add, commit and push to heroku in one command

If all of the following apply to you:

  • You are making a heroku app
  • You are playing with something that needs to be tested live on the server (eg Incoming mail script)
  • You are lazy and the three commands to add stuff to your git repo, commit it and push to heroku are just too much for you in the wee hours of the morning
  • You don't understand why using the message "changed" for a version control contribution would ever be frustrating for someone else
  • You don't care
Then do the following:
  • Make a script called up (no extension) in your script folder alongside generate
  • Put this in the file:
    git add .
    git commit -m "minor change for live test"
    git push heroku
  • In Terminal, navigate to your app's folder, and type chmod a+x script/up
Now you can:
  • Commit your files and push them live in one simple command: script/up

Posted by Effisfor 

1 comment

Apr 16, 2010
Maysoon said...
You'd never get a job at-Rolls Royce

Leave a comment...