This is a follow up to Deploying to Heroku using git on bitbucket.
I am not new to Ruby on Rails (RoR). I am new to git, Heroku, and Bitbucket. I'm missing some fundamental concepts I am just not getting reading books and playing around.
I have followed along with https://devcenter.heroku.com/articles/getting-started-with-jruby#introduction. It has been invaluable in getting me started with deploying RoR to Heroku. If I follow along closely, things work. My questions below assume everything in that tutorial is working correctly.
I'm hoping these very basic questions will help others facing the same learning challenges I am.
My first basic question: Are Heroku repositories private by default?
My second basic question: What does the heroku
command do? Sometimes it seems to run something on the server as in heroku config:set MY_VARIABLE=MY_VALUE
which, I think, sets an environment variable on the server running my website. Sometimes it seems to run things on my devlopement (i.e. local) machine as in heroku local web -f Procfile.windows
For the sake of argument, assume a Heroku repository is not private and I want to host my repository (repo) on Bitbucket.
After installing the Heroku toolbelt, I have done a git clone https://github.com/heroku/jruby-getting-started.git myProject
from a command processor.
Ok, I understand the "git clone". If my current working directory is f:\x then the clone operation will create f:\x\myProject (and subdirectories) complete with sample code as well as a repository.
I make and save my changes to the local (sample) files (e.g. f:\x\myProject\app\views\index.erb) with my favorite text editor. (In my case, the Atom text editor.)
I do http://localhost:5000
allows me to see myProject on a local browser. This works fine.
I then do a
git add .
git commit -m "Some comment"
git push heroku master
heroku open
So now I pushed the changed sample code to Heroku. The heroku open
opens a new tab in my web browser. Magically, myProject.heroku.com is now working with the changes I made to f:\x\myProject\app\views\index.erb.
Assume I want to host my repository on Bitbucket.
Now I get lost. Do I clone f:\x\myProject to Bitbucket? Do I push to Bitbucket?
I note from https://devcenter.heroku.com/articles/git
Before you can push an app to Heroku, you’ll need to initialize a local Git repository and commit your files to it. For example, if you have an app in a directory, myapp, then create a new repository for it:
Is that really true? Is there no way to push from Bitbucket to Heroku without having a repository on Heroku?
I'm running Windows 7 with Cygwin and Heroku's toolbelt installed. What tool do I use to create and copy my local repository to Bitbucket?
Once I have a repo on Bitbucket, what tool and git commands do I use to place my code on Heroku without creating a repo on Heroku or updating the repo?
Thank you.