Ruby on Rails Development with Git and Github

This tutorial shows you how to setup your Ruby on Rails development environment to use git and github. This serves as a prerequisite to our server deployment series.

We cover setting up your SSH keys, configuring your github account, creating your git repository and pushing your code to github.

Here are the commands used in the tutorial.

# create an SSH key and give it a strong password
ssh-keygen -t rsa

# Add your public ssh key to github
cat .ssh/id_rsa.pub

# test github connection
ssh -T git@github.com

# configure git
git config --global user.name "Creston Jamison"
git config --global user.email creston@example.com
git config --global push.default simple

# review .gitignore and make changes if necessary
cd apps/testapp
ls -al
more .gitignore

# create local git repository
git init

# add files and commit to the local repository
git add .
git commit -m "first commit"

# add a github repository as a remote called origin
git remote add origin git@github.com:cjamison/testapp.git

# push your local changes to the master branch on the origin remote
git push -u origin master

Please go ahead and leave a comment below if you have any questions about this tutorial.