Apply git to our project

So how we apply the git in our project?

  1. In shell, change directory into the rails app project.
  2. git init the local repo.
  3. git add . to add all the files to the repo.
  4. git commit -m "init repo with all files" to commit the just added changes. It must comes with a message.
  5. git add the_changed_files after every time some files are changed (and you need that changes)
  6. git commit -m "message here" to commit the changes every time you make.

Please note that this all happen in your local device. Git repos are distributed so every one own a local code base. There are several benefits on this:

  1. Can work in offline.
  2. No centralized server.
  3. Fast code changing. (branch switching)

What’s next? We’re going to take a look at “Push git to server repo”.

overlaied image when clicked on thumbnail

Makzan | Ruby on rails 101 | Table of Content