Skip to content

Commit acd6917

Browse files
committed
Merge branch 'maint'
* maint: git-apply: fix whitespace stripping apply --index-info: fall back to current index for mode changes core-tutorial: minor cleanup documentation: replace Discussion section by link to user-manual chapter user-manual: todo updates and cleanup user-manual: fix introduction to packfiles user-manual: move packfile and dangling object discussion user-manual: rewrite object database discussion user-manual: reorder commit, blob, tree discussion user-manual: rewrite index discussion user-manual: create new "low-level git operations" chapter user-manual: rename "git internals" to "git concepts" user-manual: move object format details to hacking-git chapter user-manual: adjust section levels in "git internals" revision walker: --cherry-pick is a limited operation git-sh-setup: typofix in comments
2 parents d3392f7 + d7416ec commit acd6917

File tree

10 files changed

+613
-1009
lines changed

10 files changed

+613
-1009
lines changed

Documentation/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ cmd-list.made: cmd-list.perl $(MAN1_TXT)
123123
perl ./cmd-list.perl
124124
date >$@
125125

126-
git.7 git.html: git.txt core-intro.txt
126+
git.7 git.html: git.txt
127127

128128
clean:
129129
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep

Documentation/core-intro.txt

Lines changed: 0 additions & 592 deletions
This file was deleted.

Documentation/core-tutorial.txt

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,24 @@ A git core tutorial for developers
44
Introduction
55
------------
66

7-
This is trying to be a short tutorial on setting up and using a git
8-
repository, mainly because being hands-on and using explicit examples is
9-
often the best way of explaining what is going on.
7+
This tutorial explains how to use the "core" git programs to set up and
8+
work with a git repository.
109

11-
In normal life, most people wouldn't use the "core" git programs
12-
directly, but rather script around them to make them more palatable.
13-
Understanding the core git stuff may help some people get those scripts
14-
done, though, and it may also be instructive in helping people
15-
understand what it is that the higher-level helper scripts are actually
16-
doing.
10+
If you just need to use git as a revision control system you may prefer
11+
to start with link:tutorial.html[a tutorial introduction to git] or
12+
link:user-manual.html[the git user manual].
13+
14+
However, an understanding of these low-level tools can be helpful if
15+
you want to understand git's internals.
1716

1817
The core git is often called "plumbing", with the prettier user
1918
interfaces on top of it called "porcelain". You may not want to use the
2019
plumbing directly very often, but it can be good to know what the
2120
plumbing does for when the porcelain isn't flushing.
2221

23-
The material presented here often goes deep describing how things
24-
work internally. If you are mostly interested in using git as a
25-
SCM, you can skip them during your first pass.
26-
2722
[NOTE]
28-
And those "too deep" descriptions are often marked as Note.
29-
30-
[NOTE]
31-
If you are already familiar with another version control system,
32-
like CVS, you may want to take a look at
33-
link:everyday.html[Everyday GIT in 20 commands or so] first
34-
before reading this.
23+
Deeper technical details are often marked as Notes, which you can
24+
skip on your first reading.
3525

3626

3727
Creating a git repository
@@ -1686,5 +1676,3 @@ merge two at a time, documenting how you resolved the conflicts,
16861676
and the reason why you preferred changes made in one side over
16871677
the other. Otherwise it would make the project history harder
16881678
to follow, not easier.
1689-
1690-
[ to be continued.. cvsimports ]

Documentation/git.txt

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ FURTHER DOCUMENTATION
134134
See the references above to get started using git. The following is
135135
probably more detail than necessary for a first-time user.
136136

137-
The <<Discussion,Discussion>> section below and the
138-
link:core-tutorial.html[Core tutorial] both provide introductions to the
139-
underlying git architecture.
137+
The link:user-manual.html#git-concepts[git concepts chapter of the
138+
user-manual] and the link:core-tutorial.html[Core tutorial] both provide
139+
introductions to the underlying git architecture.
140140

141141
See also the link:howto-index.html[howto] documents for some useful
142142
examples.
@@ -474,7 +474,56 @@ for further details.
474474

475475
Discussion[[Discussion]]
476476
------------------------
477-
include::core-intro.txt[]
477+
478+
More detail on the following is available from the
479+
link:user-manual.html#git-concepts[git concepts chapter of the
480+
user-manual] and the link:core-tutorial.html[Core tutorial].
481+
482+
A git project normally consists of a working directory with a ".git"
483+
subdirectory at the top level. The .git directory contains, among other
484+
things, a compressed object database representing the complete history
485+
of the project, an "index" file which links that history to the current
486+
contents of the working tree, and named pointers into that history such
487+
as tags and branch heads.
488+
489+
The object database contains objects of three main types: blobs, which
490+
hold file data; trees, which point to blobs and other trees to build up
491+
directory heirarchies; and commits, which each reference a single tree
492+
and some number of parent commits.
493+
494+
The commit, equivalent to what other systems call a "changeset" or
495+
"version", represents a step in the project's history, and each parent
496+
represents an immediately preceding step. Commits with more than one
497+
parent represent merges of independent lines of development.
498+
499+
All objects are named by the SHA1 hash of their contents, normally
500+
written as a string of 40 hex digits. Such names are globally unique.
501+
The entire history leading up to a commit can be vouched for by signing
502+
just that commit. A fourth object type, the tag, is provided for this
503+
purpose.
504+
505+
When first created, objects are stored in individual files, but for
506+
efficiency may later be compressed together into "pack files".
507+
508+
Named pointers called refs mark interesting points in history. A ref
509+
may contain the SHA1 name of an object or the name of another ref. Refs
510+
with names beginning `ref/head/` contain the SHA1 name of the most
511+
recent commit (or "head") of a branch under developement. SHA1 names of
512+
tags of interest are stored under `ref/tags/`. A special ref named
513+
`HEAD` contains the name of the currently checked-out branch.
514+
515+
The index file is initialized with a list of all paths and, for each
516+
path, a blob object and a set of attributes. The blob object represents
517+
the contents of the file as of the head of the current branch. The
518+
attributes (last modified time, size, etc.) are taken from the
519+
corresponding file in the working tree. Subsequent changes to the
520+
working tree can be found by comparing these attributes. The index may
521+
be updated with new content, and new commits may be created from the
522+
content stored in the index.
523+
524+
The index is also capable of storing multiple entries (called "stages")
525+
for a given pathname. These stages are used to hold the various
526+
unmerged version of a file when a merge is in progress.
478527

479528
Authors
480529
-------

0 commit comments

Comments
 (0)