[短评] Version Control with Git, 3rd Edition |
[短评] Version Control with Git, 3rd Edition |
|
2023-12-28, 15:08
Post
#1
|
|||
GEEKs will Eventually Evolve into Kryptonians. | All my jokes are cries for help.
Group: Avatar Posts: 1156 Joined: 2008-05-18 Member No.: 21346 |
» Click to show Spoiler - click again to hide... « * 书名:Version Control with Git, 3rd Edition * 出版社:O'Reilly * ISBN:9781492091196 9/10 分。个别章节排序不太合理,有些命令讲得不够详细,但是总体上十分推荐这本书。说来丢人,长久以来,Git 对我而言只是一个使用命令行的网盘管理工具。读完这本教程后,我发现 Git 是一个使用命令行的高级网盘管理工具。 第一章简述了从创建仓库到提交文件的整个过程,起步平缓。第二章难度陡增,深入讲解了一系列贯穿全书的基本概念,包括 Git 仓库的目录结构、数据类型等,我看了两遍才看懂。从知识结构上讲,先基础(Git object store)后应用(创建分支、提交更改)没有错;可是作为一本教材(而不是手册),这种排序我认为不妥当,不妨调整为: * 入门 * Chapter 1: Introduction to Git * 简单应用 * Chapter 3: Branches * Chapter 4: Commits * Chapter 5: File Management and the Index * 原理 * Chapter 2: Foundational Concepts 阅读技术类书籍时,我会先看某一章开头结尾的引言和总结,根据这些文本猜测本章内容,然后按顺序阅读,验证猜测结果。然而,这本书里每一章的摘要(Summary)全是车轱辘话,我很生气!写书不比写代码,不求你们做到红豆啄残鹦鹉粒,也不能太乱来吧。另外序言里画了一张表格(见图 1),把全书分为五个部分(基础概念,初级、中级和高级 Git 功能,使用技巧),并指出对绝大部分读者来说(软件工程师和数据科学家除外),中、高级命令不是必读内容。 » Click to show Spoiler - click again to hide... « 图 1:读者分类与必读内容。 上述说法至少错了一半。高级功能(Patch、hook、submodule 等)确实暂时用不到,我仅仅大致浏览了一遍,但是中级命令(比如 `git blame`、`git reset`、`git stash` 等)日常使用频率很高,所有 Git 用户都应该掌握。还有一点,`git add -p` 这个命令非常有用,不知为何被藏在高级功能的角落里(第十六章第一节)。 `git rebase` 这个命令有点复杂,`--onto` 参数尤其如此。书中讲得太简略了,我读了一篇博客文章([how-to-effectively-use-git-rebase-onto](https://belev.dev/how-to-effectively-use-git-rebase-onto))才搞懂。 读完全书后,我按个人理解调整了章节顺序并重新归类,放在文章最后供大家参考。 * Git Repository Structure * Git repository -- [Chapter 2] * Manage Files in Working Directories * Index -- [Chapter 5] * Stash & Reflog -- [Chapter 10] * Manage Different Files * Branch -- [Chapter 3] * Diff -- [Chapter 7] * Merge -- [Chapter 6] * Interact with Repositories * Commit -- [Chapter 4] * Find Commits -- [Chapter 8] * Alter Commits -- [Chapter 9] * Remote Repository -- [Chapter 11] |
|||
Copyright © 2005-2024 The Ring of Wonder | Time is now: 2024-06-30, 14:25 |