The Definitive Guide to Git cover

The Definitive Guide to Git

Rating 4.1
Chapters
21
Series
HZ Books · In Practice Series
ISBN
9787111349679

Tags

Summary

The Definitive Guide to Git is a Chinese-language book on Git by Jiang Xin, published by China Machine Press in 2011 as part of the HZ Books · In Practice series. It runs to 9 parts and 41 chapters plus 4 appendices, nearly 600 pages, and has been called an "encyclopedia" of Git in the industry. The content begins with the history of version control: the book first reviews the evolution from manual backups and CVS to SVN, then introduces Git, created by Linus Torvalds to manage Linux kernel development, and explains Git's practical advantages one by one—daily work backups, remote collaboration, on-site version control, rewriting commit messages, saving work in progress, and fast diff comparison. Part 1 then covers installation, configuration, Chinese-language support, and graphical clients across Linux, Mac OS X, and Windows (both Cygwin and msysGit environments). Parts 2 and 3 form the core of the book. Part 2 covers personal use of Git: initializing repositories, the staging area, the object database, reset, checkout, restoring progress with git stash, viewing history, cloning, and repository management, with "Thinking" sections explaining underlying principles such as the .git directory, committer identity, SHA-1 hashing, and command aliases. Part 3 covers team collaboration: Git protocols, conflict resolution, milestones, branching strategies, remote repositories, and patch-based email workflows. The remaining parts address advanced and operations scenarios: collaboration models (including Topgit, submodules, subtree merging, Android's multiple repositories, and Git-SVN collaboration), server setup (HTTP, Git, and SSH protocols, plus Gitolite, Gitosis, and Gerrit), migrating from CVS, SVN, and Hg to Git and cleaning up repositories, applications such as etckeeper and Gistore, cross-platform operations, and features including hooks, templates, sparse checkout, shallow cloning, grafts, and replacements; the book ends with a command index and a comparison table of commands across version control systems. The book is recommended by Git's official maintainer Junio C Hamano and others.

Editor's review

如果你想找一本能从头读到尾、又能长期摆在手边查阅的中文Git书,《Git权威指南》是绕不开的一本。它的难得之处在于“两头都硬”:既把 git add、commit、reset、checkout、stash、log、blame 等日常命令讲到能直接上手,又愿意停下来解释暂存区、对象库、引用、SHA-1 哈希这些底层机制——弄懂“为什么”,之后遇到任何操作失误都不会再慌。 书中的“思考”小节是亮点:为什么工作区根目录有 .git?为什么提交者信息可以随便填?为什么不用顺序数字标记提交?这种追问式的写法,在国内技术书里并不多见。 覆盖面也足够宽:个人工作流讲完,接着讲团队协同模型、分支策略、Git协议,再讲到 Gitolite、Gerrit 服务器架设和从 CVS、SVN、Hg 迁移,几乎是中小团队落地 Git 的全流程。书中对中文支持、Cygwin 与 msysGit 等 Windows 环境的细节着墨不少,反映了成书年代的真实痛点。 需要提醒的是,本书出版于2011年,示例中的部分命令选项与工具(如 msysGit、TortoiseGit 旧版本、Gitosis)已不再是主流,读者应以书中原理为主线,动手时结合官方文档核对最新用法。即便如此,这本书依然是一部扎实、耐读、值得收藏的Git参考书。

Who it's for

A good fit for

  • 已经会用基本 commit/push,想弄懂 Git 底层原理的开发者
  • 需要为团队制定分支与协同规范的技术负责人
  • 负责搭建 Git 服务器、从 SVN 迁移版本库的运维人员
  • 习惯纸质书对照查阅命令的计算机专业学生

Not a good fit for

  • 完全零基础、只想半小时内学会提交代码的读者
  • 只需要图形化客户端操作、不关心原理的产品或设计人员
  • 追求最新 Git 版本特性与云托管平台流程的读者

Reading tips

  1. 先读第1篇建立印象,再精读第2篇第4—11章,边读边在临时仓库里复现示例。
  2. 团队负责人可直接跳到第3、4篇,结合自身分支模型做取舍,不必逐章通读。
  3. 遇到命令疑惑时用书末命令索引与各版本控制系统对照表反查。
  4. 注意成书年代,实践时以官方文档核对命令选项,避免照搬过时工具流程。

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Preface
  2. Part 1 Getting to Know Git
  3. Chapter 1 The Past and Present of Version Control
  4. Chapter 2 Reasons to Love Git
  5. Chapter 3 Installing and Using Git
  6. Part 2 Git Solo
  7. Chapter 4 Initializing Git
  8. Chapter 5 The Git Staging Area
  9. Chapter 6 Git Objects
  10. Chapter 7 Git Reset
  11. Chapter 8 Git Checkout
  12. Chapter 9 Restoring Progress
  13. Chapter 10 Basic Git Operations
  14. Chapter 11 Traveling Through History
  15. Part 3 Git and Teams
  16. Part 4 Git Collaboration Models
  17. Part 5 Setting Up Git Servers
  18. Part 6 Repository Migration
  19. Part 7 Other Git Applications
  20. Part 8 Cross-Platform Git Operations and Features
  21. Part 9 Appendices (Git Command Index and Comparison of Version Control Systems)

FAQ

这本书适合零基础学Git吗?
不太适合当第一本书。它是“百科全书”式的系统专著,默认读者有基本开发经验。零基础建议先看三五页的入门教程跑通流程,再回来读第2篇补原理。
2011年出版的书,现在读会不会过时?
Git的核心模型——对象、暂存区、分支、引用——十几年来没有本质变化,这部分内容依然准确可靠。需要留意的是安装章节中的 msysGit、Gitosis 等已非主流工具,以及部分命令选项已更新。
书里的示例需要在什么环境下运行?
书中示例以命令行方式在 Linux、Mac OS X 和 Windows(Cygwin、msysGit)下给出。如今在任一平台安装官方 Git 后,开一个临时目录建测试仓库即可跟着做,不影响理解。
读完能到什么程度?
认真读完并动手实践,基本能独立处理日常提交、分支合并、冲突解决、历史追溯与误操作恢复,也能理解团队协同模型和服务器架设思路,达到团队中“Git 明白人”的水平。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

More by the same author

Top rated in the same category