I sometimes develop websites for personal interests or for friends. Since I'm the only one to work on them, I did not really pay too much attention on version control. But there was a small project that I worked for my friend, which required me to look into a version control system (because he who has no coding experience also wanted to help updating source codes).
The information below is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others.
Git First-time System Setup:
After installing, execute below commands to set up the system. This is done only one time:
$ git config --global user.name "user-name"
$ git config --global user.email email@example.com
$ git config --global core.editor "gvim -f"
First-time Repository Setup
These steps are necessary each time a new repository is created. First, navigate to the root directory of the website/applicew repository:
$ git init
Initialized empty Git repository in /home/<username>/www/<project_name>/.git/
By default, Git tracks the changes of all the files, but we can use .gitignore that locates in the application root directory to control what to track.
$ vim .gitignore
# Ignore bundler config
# Ignore the default SQLite database.
# Ignore all logfiles and tempfiles.
# Ignore other unneeded files.
More to come...!