1. 安装git服务

    yum install git-core git-daemon
  2. 添加git用户

    # add user
    adduser git
    # set password for this new user
    passwd git
  3. 在服务端创建空白版本库

    # switch current user to git
    su git
    # switch pwd to home
    cd ~
    # create repo folder
    mkdir book.git
    # create a pure blank repo
    git --bare init
  4. 在客户端创建版本库

    # create repo folder
    cd ~ && create book.git
    # create the repo
    git init
    # setting remote repo
    git remote add origin
    # push exchange to server
    git push origin master

Ok, that's all!

you can clone the repo in another machine by:

git clone

ignore files

Sometimes temporary files and folders will be created and we don't want they enter our git repo. How should we do?

A simple method, you only need create a file with filename .gitignore and log the file or folder. Here is a example:

# filename .gitignore

Some other methods will do the same thing. I will add latter.