At first this seems confusing, because we associate git only as a tool for managing source code (some of us only use git in conjunction with github, and have never fathomed the idea that we can use git to send runnable code to the cloud).
So, I was forced to decouple my notion of “git” as a version control tool from “git” as a generic source code commisioning utility, when I decided I wanted to experiement with deploying a blog (using the excellent 5-minute toto blogging tool : http://www.rubyinside.com/deploy-blog-with-toto-and-heroku-2962.html), that others could help and collaborate on.
I quickly found that I didn’t fully understand heroku’s model.
The mystery about this all is simply that git doesn’t care how many repos you associate it with ! You can push to github and heroku at the same time. Each repo is independent.
2) Once you create an app, you push code to the heroku server’s under the git branch of that app.
Heroku uses git for code deployment. So… what if your code is already on git ?
3) Git lets you have multiple repositories ! The “git push” command actually can take 2 arguments – a repo, and a branch. Thus, when we deploy
git push heroku master
We are actually pushing the master branch to heroku. We can also push to git using :
git push origin master, if the origin of source is from git.
The punchline : You can easily reproduce your environment for pushing code to heroku, and pulling it from github, on multiple or any machines as follows –
1) use heroku to add your public keys :
jaylinux@ubuntu:~$ heroku keys:add
Found the following SSH public keys:
1) github_rsa.pub
2) id_rsa.pub
Which would you like to use with your Heroku account? 2
2) git clone your project from the git repo.
3) git add your (already existing) heroku app to your git configuration as a 2nd remote repository :
git add remote heroku git@heroku.com:fierce-samurai-6972.git
4) Make some changes, push them to heroku :
git push heroku master
5) Don’t forget to sync your changes with github so you don’t lose your work on github !
git push (or ‘git push origin master’, or ‘git push github master’)
quiet-warrior-557
fierce-samurai-6972
gentle-ice-2166
falling-autumn-9592
simple-rain-5194
jaylinux@ubuntu:~/Development/rudolfblog$ heroku info –app fierce-samurai-6972
=== fierce-samurai-6972
Addons: Shared Database 5MB
Collaborators: mfenwick100@gmail.com
sesanker0@gmail.com
Domain Name: fierce-samurai-6972.heroku.com
Dynos: 1
Git URL: git@heroku.com:fierce-samurai-6972.git
Owner: jayunit100@gmail.com
Repo Size: 500k
Slug Size: 1M
Stack: bamboo-mri-1.9.2
Web URL: http://fierce-samurai-6972.heroku.com/
Workers: 0
2020 has not been a year we would have been able to predict. With a worldwide pandemic and lives thrown out of gear, as we head into 2021, we are thankful that our community and project continued to receive new developers, users and make small gains. For that and a...
It has been a while since we provided an update to the Gluster community. Across the world various nations, states and localities have put together sets of guidelines around shelter-in-place and quarantine. We request our community members to stay safe, to care for their loved ones, to continue to be...
The initial rounds of conversation around the planning of content for release 8 has helped the project identify one key thing – the need to stagger out features and enhancements over multiple releases. Thus, while release 8 is unlikely to be feature heavy as previous releases, it will be the...