@ -42,10 +42,9 @@ How to get a git repository
@@ -42,10 +42,9 @@ How to get a git repository
It will be useful to have a git repository to experiment with as you
read this manual.
The best way to get one is by using the gitlink:git-clone[1] command
to download a copy of an existing repository for a project that you
are interested in. If you don't already have a project in mind, here
are some interesting examples:
The best way to get one is by using the gitlink:git-clone[1] command to
download a copy of an existing repository. If you don't already have a
project in mind, here are some interesting examples:
------------------------------------------------
# git itself (approx. 10MB download):
@ -63,21 +62,18 @@ directory, you will see that it contains a copy of the project files,
@@ -63,21 +62,18 @@ directory, you will see that it contains a copy of the project files,
together with a special top-level directory named ".git", which
contains all the information about the history of the project.
In most of the following, examples will be taken from one of the two
repositories above.
[[how-to-check-out]]
How to check out a different version of a project
-------------------------------------------------
Git is best thought of as a tool for storing the history of a
collection of files. It stores the history as a compressed
collection of interrelated snapshots (versions) of the project's
contents.
Git is best thought of as a tool for storing the history of a collection
of files. It stores the history as a compressed collection of
interrelated snapshots of the project's contents. In git each such
version is called a <<def_commit,commit>>.
A single git repository may contain multiple branches. It keeps track
of them by keeping a list of <<def_head,heads>> which reference the
latest version on each branch; the gitlink:git-branch[1] command shows
latest commit on each branch; the gitlink:git-branch[1] command shows
you the list of branch heads:
------------------------------------------------
@ -149,32 +145,27 @@ current branch:
@@ -149,32 +145,27 @@ current branch:
------------------------------------------------
$ git show
commit 2b5f6dcce5bf94b9b119e9ed8d537098ec61c3d2
Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date: Sat Dec 2 22:22:25 2006 -0800
[XFRM]: Fix aevent structuring to be more complete.
aevents can not uniquely identify an SA. We break the ABI with this
patch, but consensus is that since it is not yet utilized by any
(known) application then it is fine (better do it now than later).
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Somebody hands you a copy of a file, and asks which commits modified a
file such that it contained the given content either before or after the
@ -1105,20 +1096,14 @@ backup files made by your editor. Of course, 'not' tracking files with git
@@ -1105,20 +1096,14 @@ backup files made by your editor. Of course, 'not' tracking files with git
is just a matter of 'not' calling "`git add`" on them. But it quickly becomes
annoying to have these untracked files lying around; e.g. they make
"`git add .`" and "`git commit -a`" practically useless, and they keep
showing up in the output of "`git status`", etc.
showing up in the output of "`git status`".
Git therefore provides "exclude patterns" for telling git which files to
actively ignore. Exclude patterns are thoroughly explained in the
gitlink:gitignore[5] manual page, but the heart of the concept is simply
a list of files which git should ignore. Entries in the list may contain
globs to specify multiple files, or may be prefixed by "`!`" to
explicitly include (un-ignore) a previously excluded (ignored) file
(i.e. later exclude patterns override earlier ones). The following
example should illustrate such patterns:
You can tell git to ignore certain files by creating a file called .gitignore
in the top level of your working directory, with contents such as:
-------------------------------------------------
# Lines starting with '#' are considered comments.