Table of Content
Apply git to our project
So how we apply the git in our project?
- In shell, change directory into the rails app project.
git init
the local repo.git add .
to add all the files to the repo.git commit -m "init repo with all files"
to commit the just added changes. It must comes with a message.git add the_changed_files
after every time some files are changed (and you need that changes)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:
- Can work in offline.
- No centralized server.
- Fast code changing. (branch switching)
What’s next? We’re going to take a look at “Push git to server repo”.