1. 前言
Git是一个开源的分布式版本控制系统,可以有效、高速地处理从很小到非常大的项目版本管;
2. Git基本原理
2.1 哈希
哈希是一系列的加密算法,特点如下:
1. 不管输入数据量多大,输入到同一个哈希算法,得到的密文长度一定
2. 哈希算法确定,输入的数据确定,那么输出的密文保持不变
3. 哈希算法不可逆
4. Git用的是SHA-1算法
5. 哈希算法可以用来被校验文件
2.2 版本保存机制
3. Git安装
4. Git本地结构
5. 代码托管中心
5.1 团队内协作
5.2 跨团队协作
6. Git命令
6.1 本地库初始化
6.2 设置签名
6.3 添加 & 提交
6.4 查看历史记录
6.5 版本切换
操作HEAD指针完成版本控制切换
6.6 删除操作
6.7 比较差异
7. Git分支管理
7.1 分支好处
1. 在版本控制中,使用多条线同时推进多个任务,提升效率
2. 一个分支开发失败,不影响其他任何分支