本系列为个人学习Git参照廖雪峰老师的笔记
- 本文内容:Git基本概念与版本库创建(一)
参考笔记:
https://www.liaoxuefeng.com/wiki/896043488029600
0 Git简介
0-1 分布式版本控制系统
集中式

分布式

0-2 跟踪修改
git 跟踪并管理的是修改,而非文件
- 新增了一行
- 删除了一行
- 创建一个新文件
- 修改字符
- 。。。
关注点不在于文件本身,而是文件的修改
1 Git版本控制
假定你本地已经安装并配置好了git
1-1 创建版本库
// 创建仓库
git init
// 添加修改
git add
// 提交修改
git commit
Practice
➜ learngit git init
已初始化空的 Git 仓库于 /home/rei/develop/learngit/.git/
➜ learngit git:(master) ls -al
总用量 12
drwxrwxr-x 3 rei rei 4096 7月 8 16:21 .
drwxrwxr-x 6 rei rei 4096 7月 8 16:21 ..
drwxrwxr-x 7 rei rei 4096 7月 8 16:21 .git
➜ learngit git:(master) vim teacher_ma.txt
➜ learngit git:(master) ✗ cat teacher_ma.txt
Teacher Ma eats three wolves
Teacher Ma eats shi tou ren
➜ learngit git:(master) ✗ git add teacher_ma.txt
➜ learngit git:(master) ✗ git commit -m "teacher Ma's lesson"
[master (根提交) f2a1a21] teacher Ma's lesson
1 file changed, 3 insertions(+)
create mode 100644 teacher_ma.txt
➜ learngit git:(master)
本文介绍了Git的基本概念,强调了它作为分布式版本控制系统的优势。通过实例展示了如何使用Git进行版本控制,包括创建版本库、跟踪修改、添加文件及提交更改。实践部分演示了从初始化Git仓库到提交首个文件的完整过程。

1282

被折叠的 条评论
为什么被折叠?



