Information Technology Reference
In-Depth Information
* 0d6501b (info) i3
* ab087d1 i2
* 6f4364e i1
| * 23d9855 (HEAD, doc) d3
| * f7651b8 d2
| * 6042953 d1
|/
* 7c9bc41 (master) m3
* 9cf5f5a m2
* ebf4409 m1
The parameter
--graph
passed to
$ git log
turns on the visibility of lines con-
necting commits,
--oneline
compresses the output to a line pre-commit with
SHA-1 shortened to seven characters and
--decorate
turns on symbolic references
such as
HEAD
,
master
,
doc
, and
info
. The parameter
--all
for
$ git log
and
$ gitk
commands has the same meaning: it causes the revisions stored in all
branches available in the repository to be included. By default, only the commits in-
cluded in the current branch are displayed.
If you now switch to the branch named
master
with the command:
$ git checkout master
the working directory will contain only three files
m1.txt
,
m2.txt,
and
m3.txt
.
You can verify it with the
$ ls
command . In a similar fashion, if you switch to the
branch
doc
with
$ git checkout doc
, then the working directory will contain
six files:
d1.txt
,
d2.txt
,
d3.txt
,
m1.txt
,
m2.txt
, and
m3.txt
. And if you
switch to the branch
info
, the working directory will contain the files:
i1.txt
,
i2.txt
,
i3.txt
,
m1.txt
,
m2.txt
, and
m3.txt
. That's why I insist on creating
commits such as
m1
,
m2
,
d1
,
d2
, and so forth. You can easily verify how the com-
mands you issue influence the working directory. A simple
$ ls
command will show
you the complete contents of your working directory—there's no need to inspect the
files.
Hint
You can list the files stored in the info branch without switching branches with
the
$ git show info^{tree}
command. In a similar way, you can list the files in
an arbitrary revision with
$ git show SHA-1^{tree}
.