Workspace:工作区
Index / Stage:暂存区
Repository:仓库区(或本地仓库)
Remote:远程仓库
1.安装git ,配置
# 安装
yum install git
# 配置用户名和邮箱
git config --global user.name "graycat"
git config --global user.email "test@qq.com"
# 创建本地版本库
mkdir gitsave
cd gitsave
git init
# 显示当前的Git配置
$ git config --list
# 编辑Git配置文件
$ git config -e [--global]
# 设置提交代码时的用户信息
$ git config [--global] user.name "[name]"
$ git config [--global] user.email "[email address]"
2.克隆远程项目
# 克隆
git clone https://git.oschina.net/Tocy/SampleCode.git
# 查看当前克隆地址
git remote -v
# 查看当前项目修改状态
git status
# 查看修改的具体内容
git diff
# 新加的文件纳入git管理
git add test.text
# 提交
git commit test.text
# 删除
git rm -f test.txt
# 查看日志 (仅显示摘要)
git log --stat
# 改名文件,并且