You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This book covers how to use Git with 30 or so verbs such as `checkout`, `branch`, `remote`, and so on.
5
-
But because Git was initially a toolkit for a VCS rather than a full user-friendly VCS, it has a bunch of verbs that do low-level work and were designed to be chained together UNIX style or called from scripts.
6
-
These commands are generally referred to as ``plumbing'' commands, and the more user-friendly commands are called ``porcelain'' commands.
The book's first nine chapters deal almost exclusively with porcelain commands.
9
-
But in this chapter, you'll be dealing mostly with the lower-level plumbing commands, because they give you access to the inner workings of Git, and help demonstrate how and why Git does what it does.
10
-
Many of these commands aren't meant to be used manually on the command line, but rather to be used as building blocks for new tools and custom scripts.
When you run `git init` in a new or existing directory, Git creates the `.git` directory, which is where almost everything that Git stores and manipulates is located.
13
-
If you want to back up or clone your repository, copying this single directory elsewhere gives you nearly everything you need.
14
-
This entire chapter basically deals with the stuff in this directory.
15
-
Here's what it looks like:
14
+
当你在一个新目录或已有目录执行 `git init` 时,Git 会创建一个 `.git` 目录。
15
+
这个目录包含了几乎所有 Git 存储和操作的对象。
16
+
如果你想备份或复制一个版本库,只需把这个目录拷贝至另一处即可。
17
+
本章探讨的所有内容,均位于这个目录内。
18
+
该目录的结构如下所示:
16
19
17
20
[source,console]
18
21
----
@@ -26,12 +29,13 @@ objects/
26
29
refs/
27
30
----
28
31
29
-
You may see some other files in there, but this is a fresh `git init` repository – it's what you see by default.
30
-
The `description` file is only used by the GitWeb program, so don't worry about it.
31
-
The `config` file contains your project-specific configuration options, and the `info` directory keeps a global exclude file (((excludes))) for ignored patterns that you don't want to track in a .gitignore file.
32
-
The `hooks` directory contains your client- or server-side hook scripts, which are discussed in detail in <<_git_hooks>>.
This leaves four important entries: the `HEAD` and (yet to be created) `index` files, and the `objects` and `refs` directories.
35
-
These are the core parts of Git.
36
-
The `objects` directory stores all the content for your database, the `refs` directory stores pointers into commit objects in that data (branches), the `HEAD` file points to the branch you currently have checked out, and the `index` file is where Git stores your staging area information.
37
-
You'll now look at each of these sections in detail to see how Git operates.
0 commit comments