Faster git deployment

23 Jun 2014 | 1 minute read

Tags: git , vcs , heroku , PaaS

This trick let’s you push to two repositories with one command. It is great for projects that need really rapid development and aren’t yet populated by many users. Before using make sure that deploying with every git push will not result with catastrophic consequences.

I assume Github for version control and Heroku for hosting, but it works with any remote Git repository and Cloud Platform offering deployment by git.

First, repo needs to be created:

$ git init
$ git remote add origin

or cloned:

$ git clone

Second, add heroku remote:

$ git remote set-url origin --push --add

Previous command replaces Github’s push remote. To re-add it:

$ git remote set-url origin --push --add

If everything went well you should get something like this:

$ git remote -v
origin (fetch)
origin (push)
origin (push)

Done :)

To push&deploy, after some commits, just:

$ git push

Let me know if you think this trick is awesome, terrible or you know how to improve it even further!

Just a random Octocat image

comments powered by Disqus