Friday, April 21, 2017

Create a New Repository and Push a Ruby on Rails project to Github

Here are the simplified procedures to create a new Github repository and push a new Ruby on Rails project to Github.

1. For example, a new Ruby on Rails project named toy_app is created using Linux shell terminal:

$ cd ~
$ rails _5.0.1_ new toy_app
$ cd toy_app/

2. (Optional): Install local Gem without production:
$ bundle install --without production

3. Put the Rails project under version control with Git:
$ git init
$ git add -A
$ git commit -m "Initialize repository"

4. In Firefox, go to Github https://github.com/YourGithubAccount/

5. In the Github's Create a new repository windows:
  • Give a repository name (e.g. toy_app)
  • (Optional): Write a Description if you like 
  • Public repository is free of charge as of the time of writing
  • Click the Create repository button



6. In the repository setup windows, I selected the push an existing repository from the command line method:
  • In Linux shell terminal:
$ git remote add origin https://github.com/jimmy2046/toy_app.git
$ git push -u origin master

7. Done. A new Ruby on Rails project is pushed to Github.

No comments:

Post a Comment

How to kill an abandoned process in Linux/Unix

I remembered it, then I forgot, then I remembered it, and then I forgot again. In case of a Linux/Unit process hang, I have to figure out ...