Skip to content

Commit 6984730

Browse files
committed
boom
0 parents  commit 6984730

File tree

99 files changed

+19161
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+19161
-0
lines changed

.gitignore

Whitespace-only changes.

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
book.git-scm.com

book.pdf

673 KB
Binary file not shown.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2+
"http://www.w3.org/TR/html4/strict.dtd">
3+
<html>
4+
<head>
5+
<title>Git Book - Git Directory and Working Directory</title>
6+
<meta http-equiv="content-language" content="en">
7+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
8+
<link rel="icon" href="favicon.png" type="image/png">
9+
<link rel="stylesheet" href="assets/blueprint/screen.css" type="text/css" media="screen, projection">
10+
<link rel="stylesheet" href="assets/blueprint/print.css" type="text/css" media="print">
11+
<!--[if IE]><link rel="stylesheet" href="assets/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
12+
<link rel="stylesheet" href="assets/stylesheets/mac_classic.css" type="text/css" media="screen, projection">
13+
<link rel="stylesheet" href="assets/stylesheets/style.css" type="text/css" media="screen, projection">
14+
</head>
15+
16+
<body>
17+
<div class="container chapter showgrids">
18+
19+
<div class="span-21 header">
20+
<div class="nav"><a href="1_the_git_object_model.html">Prev</a> <a href="1_the_git_index.html">Next</a></div>
21+
<div class="title"><a href='index.html'>Git Community Book</a></div>
22+
</div>
23+
24+
<div class="span-21">
25+
<br/>
26+
</div>
27+
28+
<div class="span-21">
29+
<h2>Git Directory and Working Directory</h2>
30+
31+
<h3>The Git Directory</h3>
32+
33+
<p>The 'git directory' is the directory that stores all Git's history and meta
34+
information for your project - including all of the objects (commits, trees,
35+
blobs, tags), all of the pointers to where different branches are and more.</p>
36+
37+
<p>There is only one Git Directory per project (as opposed to one per
38+
subdirectory like with SVN or CVS), and that directory is (by default, though
39+
not necessarily) '.git' in the root of your project. If you look at the
40+
contents of that directory, you can see all of your important files:</p>
41+
42+
<pre><code>$&gt;tree -L 1
43+
.
44+
|-- HEAD # pointer to your current branch
45+
|-- config # your configuration preferences
46+
|-- description # description of your project
47+
|-- hooks/ # pre/post action hooks
48+
|-- index # index file (see next section)
49+
|-- logs/ # a history of where your branches have been
50+
|-- objects/ # your objects (commits, trees, blobs, tags)
51+
`-- refs/ # pointers to your branches
52+
</code></pre>
53+
54+
<p>(there may be some other files/directories in there as well, but they are not important for now)</p>
55+
56+
<h3>The Working Directory</h3>
57+
58+
<p>The Git 'working directory' is the directory that holds the current checkout
59+
of the files you are working on. Files in this directory are often removed
60+
or replaced by Git as you switch branches - this is normal. All your history
61+
is stored in the Git Directory; the working directory is simply a temporary
62+
checkout place where you can modify the files until your next commit.</p>
63+
64+
65+
</div>
66+
67+
<div class="span-21">
68+
<hr/>
69+
<div class="center"><a href="1_the_git_object_model.html">Prev</a> <a href="1_the_git_index.html">Next</a></div>
70+
<hr/>
71+
</div>
72+
73+
<div class="span-17 footer">
74+
<div class="menu">
75+
This book is maintained by Scott Chacon, and hosting is donated by GitHub.
76+
<br>
77+
Please email me at <a href="mailto:schacon@gmail.com">schacon@gmail.com</a>
78+
with patches, suggestions and comments.
79+
</div>
80+
</div>
81+
<div class="span-4 last center">
82+
<a href="http://github.com"><img src="assets/images/github.png" alt="github logo"></a>
83+
</div>
84+
85+
</div>
86+
87+
<script type="text/javascript">
88+
var pageTracker = _gat._getTracker("UA-82337-12");
89+
pageTracker._initData();
90+
pageTracker._trackPageview();
91+
</script>
92+
<script src="http://static.getclicky.com/40584.js" type="text/javascript"></script>
93+
<noscript><p><img alt="Clicky" src="http://in.getclicky.com/40584-db6.gif" /></p></noscript>
94+
95+
</body>
96+
</html>

book/1_the_git_index.html

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2+
"http://www.w3.org/TR/html4/strict.dtd">
3+
<html>
4+
<head>
5+
<title>Git Book - The Git Index</title>
6+
<meta http-equiv="content-language" content="en">
7+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
8+
<link rel="icon" href="favicon.png" type="image/png">
9+
<link rel="stylesheet" href="assets/blueprint/screen.css" type="text/css" media="screen, projection">
10+
<link rel="stylesheet" href="assets/blueprint/print.css" type="text/css" media="print">
11+
<!--[if IE]><link rel="stylesheet" href="assets/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
12+
<link rel="stylesheet" href="assets/stylesheets/mac_classic.css" type="text/css" media="screen, projection">
13+
<link rel="stylesheet" href="assets/stylesheets/style.css" type="text/css" media="screen, projection">
14+
</head>
15+
16+
<body>
17+
<div class="container chapter showgrids">
18+
19+
<div class="span-21 header">
20+
<div class="nav"><a href="1_git_directory_and_working_directory.html">Prev</a> <a href="2_installing_git.html">Next</a></div>
21+
<div class="title"><a href='index.html'>Git Community Book</a></div>
22+
</div>
23+
24+
<div class="span-21">
25+
<br/>
26+
</div>
27+
28+
<div class="span-21">
29+
<h2>The Git Index</h2>
30+
31+
<p>The Git index is used as a staging area between your working directory
32+
and your repository. You can use the index to build up a set of changes
33+
that you want to commit together. When you create a commit, what is committed
34+
is what is currently in the index, not what is in your working directory.</p>
35+
36+
<h3>Looking at the Index</h3>
37+
38+
<p>The easiest way to see what is in the index is with the <a href="http://www.kernel.org/pub/software/scm/git/docs/git-status.html">git status</a>
39+
command. When you run git status, you can see which files are staged
40+
(currently in your index), which are modified but not yet staged, and which
41+
are completely untracked.</p>
42+
43+
<pre><code>$&gt;git status
44+
# On branch master
45+
# Your branch is behind 'origin/master' by 11 commits, and can be fast-forwarded.
46+
#
47+
# Changes to be committed:
48+
# (use "git reset HEAD &lt;file&gt;..." to unstage)
49+
#
50+
# modified: daemon.c
51+
#
52+
# Changed but not updated:
53+
# (use "git add &lt;file&gt;..." to update what will be committed)
54+
#
55+
# modified: grep.c
56+
# modified: grep.h
57+
#
58+
# Untracked files:
59+
# (use "git add &lt;file&gt;..." to include in what will be committed)
60+
#
61+
# blametree
62+
# blametree-init
63+
# git-gui/git-citool
64+
</code></pre>
65+
66+
<p>If you blow the index away entirely, you generally haven't lost any
67+
information as long as you have the name of the tree that it described.</p>
68+
69+
<p>And with that, you should have a pretty good understanding of the basics of
70+
what Git is doing behind the scenes, and why it is a bit different than most
71+
other SCM systems. Don't worry if you don't totally understand it all right
72+
now; we'll revisit all of these topics in the next sections. Now we're ready
73+
to move on to installing, configuring and using Git.</p>
74+
75+
76+
</div>
77+
78+
<div class="span-21">
79+
<hr/>
80+
<div class="center"><a href="1_git_directory_and_working_directory.html">Prev</a> <a href="2_installing_git.html">Next</a></div>
81+
<hr/>
82+
</div>
83+
84+
<div class="span-17 footer">
85+
<div class="menu">
86+
This book is maintained by Scott Chacon, and hosting is donated by GitHub.
87+
<br>
88+
Please email me at <a href="mailto:schacon@gmail.com">schacon@gmail.com</a>
89+
with patches, suggestions and comments.
90+
</div>
91+
</div>
92+
<div class="span-4 last center">
93+
<a href="http://github.com"><img src="assets/images/github.png" alt="github logo"></a>
94+
</div>
95+
96+
</div>
97+
98+
<script type="text/javascript">
99+
var pageTracker = _gat._getTracker("UA-82337-12");
100+
pageTracker._initData();
101+
pageTracker._trackPageview();
102+
</script>
103+
<script src="http://static.getclicky.com/40584.js" type="text/javascript"></script>
104+
<noscript><p><img alt="Clicky" src="http://in.getclicky.com/40584-db6.gif" /></p></noscript>
105+
106+
</body>
107+
</html>

0 commit comments

Comments
 (0)