Git: How to publish your existing app to Github

If you have an existing web app you want to publish to Github, here's how.

Step 1

Create a new Github Repo.

Step 2

Change Directory into your rails app

cd /path/to/rails_app

Initialize Git.

git init  

Check your status.

git status 

Add files to a Git repo.

git add -A

Commit the files to Git and add a message.

git commit -m "Initial commit" 

Review your git by viewing logs.

git log 

Add your newly created Github repo through remote add. Take note, origin is an arbitrary name. You can use any name.

git remote add origin git@github.com:<username>/<new_app>.git 

Push your commits to Github.

git push -u origin master 

Resources