Jon Loeliger
Git可以支持几乎无数种开发与合作的方法。它最早由Linus Torvalds创建,用于管理Linux内核开发,现已成为分布式版本控制的主流工具。但是Git的灵活性也意味着某些用户无法发挥它的最大价值。《Git版本控制管理》提供了最高效的方法教程,其友好又严谨的建议有助于你随心操控Git的各项功能。
· 学习如何在多种真实开发环境中使用Git
· 洞察Git的常用案例、初始任务和基本功能
· 理解如何在集中和分布式版本控制中使用Git
· 使用Git管理补丁、差异、合并和冲突
· 获得诸如重新定义分支(rebasing)、钩子(hook)以及处理子模块(子项目)等的高级技巧
· 学习如何结合使用Git与Subversion

—— Don Marti,编辑、记者以及会议主席
Jon Loeliger是一位自由职业的软件工程师,致力于Linux、U-Boot和Git等开源项目。他曾在Linux World等诸多会议上公开讲授Git,还为《 Linux Magazine 》撰写过数篇关于 Git的文章。
  1. Preface
  2. 1. Introduction
  3. Background
  4. The Birth of Git
  5. Precedents
  6. Time Line
  7. What’s in a Name?
  8. 2. Installing Git
  9. Using Linux Binary Distributions
  10. Debian/Ubuntu
  11. Other Binary Distributions
  12. Obtaining a Source Release
  13. Building and Installing
  14. Installing Git on Windows
  15. Installing the Cygwin Git Package
  16. Installing Standalone Git (msysGit)
  17. 3. Getting Started
  18. The Git Command Line
  19. Quick Introduction to Using Git
  20. Creating an Initial Repository
  21. Adding a File to Your Repository
  22. Configuring the Commit Author
  23. Making Another Commit
  24. Viewing Your Commits
  25. Viewing Commit Differences
  26. Removing and Renaming Files in Your Repository
  27. Making a Copy of Your Repository
  28. Configuration Files
  29. Configuring an Alias
  30. Inquiry
  31. 4. Basic Git Concepts
  32. Basic Concepts
  33. Repositories
  34. Git Object Types
  35. Index
  36. Content-Addressable Names
  37. Git Tracks Content
  38. Pathname Versus Content
  39. Object Store Pictures
  40. Git Concepts at Work
  41. Inside the .git directory
  42. Objects, Hashes, and Blobs
  43. Files and Trees
  44. A Note on Git’s Use of SHA1
  45. Tree Hierarchies
  46. Commits
  47. Tags
  48. 5. File Management and the Index
  49. It’s All About the Index
  50. File Classifications in Git
  51. Using git add
  52. Some Notes on Using git commit
  53. Using git commit --all
  54. Writing Commit Log Messages
  55. Using git rm
  56. Using git mv
  57. A Note on Tracking Renames
  58. The .gitignore File
  59. A Detailed View of Git’s Object Model and Files
  60. 6. Commits
  61. Atomic Changesets
  62. Identifying Commits
  63. Absolute Commit Names
  64. refs and symrefs
  65. Relative Commit Names
  66. Commit History
  67. Viewing Old Commits
  68. Commit Graphs
  69. Commit Ranges
  70. Finding Commits
  71. Using git bisect
  72. Using git blame
  73. Using Pickaxe
  74. 7. Branches
  75. Reasons for Using Branches
  76. Branch Names
  77. Dos and Don’ts in Branch Names
  78. Using Branches
  79. Creating Branches
  80. Listing Branch Names
  81. Viewing Branches
  82. Checking Out Branches
  83. A Basic Example of Checking Out a Branch
  84. Checking Out When You Have Uncommitted Changes
  85. Merging Changes into a Different Branch
  86. Creating and Checking Out a New Branch
  87. Detached HEAD Branches
  88. Deleting Branches
  89. 8. Diffs
  90. Forms of the git diff Command
  91. Simple git diff Example
  92. git diff and Commit Ranges
  93. git diff with Path Limiting
  94. Comparing How Subversion and Git Derive diffs
  95. 9. Merges
  96. Merge Examples
  97. Preparing for a Merge
  98. Merging Two Branches
  99. A Merge with a Conflict
  100. Working with Merge Conflicts
  101. Locating Conflicted Files
  102. Inspecting Conflicts
  103. How Git Keeps Track of Conflicts
  104. Finishing Up a Conflict Resolution
  105. Aborting or Restarting a Merge
  106. Merge Strategies
  107. Degenerate Merges
  108. Normal Merges
  109. Specialty Merges
  110. Applying Merge Strategies
  111. Merge Drivers
  112. How Git Thinks About Merges
  113. Merges and Git’s Object Model
  114. Squash Merges
  115. Why Not Just Merge Each Change One by One?
  116. 10. Altering Commits
  117. Caution About Altering History
  118. Using git reset
  119. Using git cherry-pick
  120. Using git revert
  121. reset, revert, and checkout
  122. Changing the Top Commit
  123. Rebasing Commits
  124. Using git rebase -i
  125. rebase Versus merge
  126. 11. Remote Repositories
  127. Repository Concepts
  128. Bare and Development Repositories
  129. Repository Clones
  130. Remotes
  131. Tracking Branches
  132. Referencing Other Repositories
  133. Referring to Remote Repositories
  134. The refspec
  135. Example Using Remote Repositories
  136. Creating an Authoritative Repository
  137. Make Your Own origin Remote
  138. Developing in Your Repository
  139. Pushing Your Changes
  140. Adding a New Developer
  141. Getting Repository Updates
  142. Remote Repository Operations in Pictures
  143. Cloning a Repository
  144. Alternate Histories
  145. Non-Fast-Forward Pushes
  146. Fetching the Alternate History
  147. Merging Histories
  148. Merge Conflicts
  149. Pushing a Merged History
  150. Adding and Deleting Remote Branches
  151. Remote Configuration
  152. git remote
  153. git config
  154. Manual Editing
  155. Bare Repositories and git push
  156. Publishing Repositories
  157. Repositories with Controlled Access
  158. Repositories with Anonymous Read Access
  159. Repositories with Anonymous Write Access
  160. 12. Repository Management
  161. Repository Structure
  162. The Shared Repository Structure
  163. Distributed Repository Structure
  164. Repository Structure Examples
  165. Living with Distributed Development
  166. Changing Public History
  167. Separate Commit and Publish Steps
  168. No One True History
  169. Knowing Your Place
  170. Upstream and Downstream Flows
  171. The Maintainer and Developer Roles
  172. Maintainer-Developer Interaction
  173. Role Duality
  174. Working with Multiple Repositories
  175. Your Own Workspace
  176. Where to Start Your Repository
  177. Converting to a Different Upstream Repository
  178. Using Multiple Upstream Repositories
  179. Forking Projects
  180. 13. Patches
  181. Why Use Patches?
  182. Generating Patches
  183. Patches and Topological Sorts
  184. Mailing Patches
  185. Applying Patches
  186. Bad Patches
  187. Patching Versus Merging
  188. 14. Hooks
  189. Installing Hooks
  190. Example Hooks
  191. Creating Your First Hook
  192. Available Hooks
  193. Commit-Related Hooks
  194. Patch-Related Hooks
  195. Push-Related Hooks
  196. Other Local Repository Hooks
  197. 15. Combining Projects
  198. The Old Solution: Partial Checkouts
  199. The Obvious Solution: Import the Code into Your Project
  200. Importing Subprojects by Copying
  201. Importing Subprojects with git pull -s subtree
  202. Submitting Your Changes Upstream
  203. The Automated Solution: Checking Out Subprojects Using Custom Scripts
  204. The Native Solution: gitlinks and git submodule
  205. gitlinks
  206. The git submodule Command
  207. 16. Using Git with Subversion Repositories
  208. Example: A Shallow Clone of a Single Branch
  209. Making Your Changes in Git
  210. Fetching Before Committing
  211. Committing Through git svn rebase
  212. Pushing, Pulling, Branching, and Merging with git svn
  213. Keeping Your Commit IDs Straight
  214. Cloning All the Branches
  215. Sharing Your Repository
  216. Merging Back into Subversion
  217. Miscellaneous Notes on Working with Subversion
  218. svn:ignore Versus .gitignore
  219. Reconstructing the git-svn cache
  220. Index
作者:Jon Loeliger
原版书出版商:O'Reilly Media
Jon Loeliger
Jon Loeligher,Freescale半导体公司的软件工程师,从事开源项目的工作,比如Git、Linux和U-Boot。他在Linux World等会议上公开讲授Git,而且还经常为Linux Magazine撰写稿件。
The animal on the cover of Version Control with Git is a long-eared bat. It is a fairly
large bat that is common and widespread throughout Great Britain and Ireland. It can
also be found in Japan. Often seen in colonies of 50 to a 100 or more, it lives in open
woodlands, as well as parks and gardens and in spaces under houses and church roofs.
It also hibernates in caves, where it is more solitary in habit.
The long-eared bat is a medium-size bat with a broad wingspan of about 25 cm. Its ears
are very long and have a very distinctive fold—their inner edges meet each other on the
top of the head, and their outer edges end just behind the angle of the mouth. When
the bat sleeps, it folds its ears under its wings. During flight, the ears are pointing
forward. Its fur is long, fluffy, and silky, extending a short way onto the surface of its
wings. It is dusky brown in color on top and light or dirty brown in color below. Juveniles
are pale grey, lacking the brown tinges of the adults. Their diet consists of flies,
moths, and beetles. It glides among foliage, frequently hovering to scour for insects.
When traveling to another tree, its flight is swift, strong, and close to the ground.
Long-eared bats breed in autumn and spring. Pregnant females form nursery colonies
of 100 or more in early summer, and the single young or twins are born in June and July.
Bats are the only true flying mammals. Contrary to popular misconception, they are
not blind—many can actually see very well. All British bats use echolocation to orient
themselves at night; they emit bursts of sound that are of such high frequencies they
are beyond the human range of hearing and are therefore called “ultrasound.” The bats
then listen to and interpret the echoes bounced back from objects around them (including
prey), which allows them to build a “sound-picture” of their surroundings.
Like all bats, this species is vulnerable to a number of threats, including the loss of roost
sites, as hollow trees are often cut down if thought unsafe. Pesticide use has devastating
effects, causing severe declines in insect abundance and contaminating food with potentially
fatal toxins. Insecticides applied to timbers inside buildings where roosts occur
are a particular danger—the initial treatment can wipe out whole colonies (spraying
timber where bats are roosting is now illegal), but the effects of these chemicals can be
lethal to bats for up to 20 years. In Britain, under the Wildlife and Countryside Act, it is illegal to intentionally kill, injure, take, or sell a bat; to possess a live bat or part of a
bat; and to intentionally, recklessly damage, obstruct, or destroy access to bat roosts.
Under the conservation regulations, it is an offense to damage or destroy breeding sites
or resting places. Offenders can be charged up to 5,000 pounds per bat affected and be
sentenced to six months imprisonment.