Git & Heroku set up

The One Month Rails project starts me out by installing Ruby & Rails, starting a new local project by adding a new project in Rails, getting it in version control with Git (including setting up my account, my repo and my SSH keys for deployment) and then pushing my local project up to Heroku.

It took about an hour of time to get the project created and pushed, but it’s pretty awesome to see the project live on Heroku with its own URL that anyone can access.  Of course, it’s just a default Ruby on Rails project right now with very little changed except for the README file, but it feels like a pretty big step.

There’s a couple of commands I wanted to save here so that I have them for the future.

$ rails new omrails  # Create a new Rails application in the folder omrails
$ rails server  # Run a local server (defaults to localhost:3000)
$ git init          # Set up Git on your project
$ git status    # See tracked, untracked, and staged files
$ git add .     # Add new files to Git
$ git commit -am "Initial commit"   # Save your project files to Git
$ git remote add origin git@github.com/yourusername/omrails.git     # Set up git to push to your Github repository
$ git push -u origin master    # Push your code to Github (sets the upstream the first time)
$ git push              # Push your code to Github
$ ssh -T git@github.com             # Attempt to ssh to Github
$ mv README.rdoc README.md          # Rename the file README.rdoc to README.md
$ heroku create         # Set up an application on Heroku
$ git push heroku master     # Push your code to Heroku
$ sublime .          # Open the current directory in Sublime Text
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s