]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/gittutorial.txt
Merge branch 'sp/test-i18ngrep' into maint-2.43
[thirdparty/git.git] / Documentation / gittutorial.txt
CommitLineData
b27a23e3
CC
1gittutorial(7)
2==============
3
4NAME
5----
022cf2bf 6gittutorial - A tutorial introduction to Git
b27a23e3
CC
7
8SYNOPSIS
9--------
7791a1d9 10[verse]
b27a23e3
CC
11git *
12
13DESCRIPTION
14-----------
8c7fa247 15
2de9b711 16This tutorial explains how to import a new project into Git, make
927a503c 17changes to it, and share changes with other developers.
8c7fa247 18
2de9b711 19If you are instead primarily interested in using Git to fetch a project,
cd50aba9
BF
20for example, to test the latest version, you may prefer to start with
21the first two chapters of link:user-manual.html[The Git User's Manual].
22
46e56e81 23First, note that you can get documentation for a command such as
483bc4f0 24`git log --graph` with:
8c7fa247 25
927a503c 26------------------------------------------------
3861cd55 27$ man git-log
927a503c 28------------------------------------------------
8c7fa247 29
6e702c24
CC
30or:
31
32------------------------------------------------
33$ git help log
34------------------------------------------------
35
36With the latter, you can use the manual viewer of your choice; see
37linkgit:git-help[1] for more information.
38
2de9b711 39It is a good idea to introduce yourself to Git with your name and
c14261ea
NP
40public email address before doing any operation. The easiest
41way to do so is:
66589230
JH
42
43------------------------------------------------
e0d10e1c
TP
44$ git config --global user.name "Your Name Comes Here"
45$ git config --global user.email you@yourdomain.example.com
66589230
JH
46------------------------------------------------
47
48
927a503c
BF
49Importing a new project
50-----------------------
8c7fa247 51
ad353d7e 52Assume you have a tarball `project.tar.gz` with your initial work. You
2de9b711 53can place it under Git revision control as follows.
8c7fa247 54
8db9307c 55------------------------------------------------
dcc6e28f 56$ tar xzf project.tar.gz
927a503c 57$ cd project
515377ea 58$ git init
8db9307c 59------------------------------------------------
8c7fa247 60
927a503c 61Git will reply
8c7fa247 62
927a503c 63------------------------------------------------
ef0a89a6 64Initialized empty Git repository in .git/
927a503c 65------------------------------------------------
8c7fa247 66
927a503c 67You've now initialized the working directory--you may notice a new
ad353d7e 68directory created, named `.git`.
93f9cc67 69
2de9b711 70Next, tell Git to take a snapshot of the contents of all files under the
ad353d7e 71current directory (note the `.`), with `git add`:
8c7fa247 72
8db9307c 73------------------------------------------------
927a503c 74$ git add .
8db9307c 75------------------------------------------------
8c7fa247 76
2de9b711 77This snapshot is now stored in a temporary staging area which Git calls
93f9cc67 78the "index". You can permanently store the contents of the index in the
ad353d7e 79repository with `git commit`:
8c7fa247 80
927a503c 81------------------------------------------------
66589230 82$ git commit
927a503c 83------------------------------------------------
8c7fa247 84
93f9cc67 85This will prompt you for a commit message. You've now stored the first
2de9b711 86version of your project in Git.
8c7fa247 87
84dee6bb
BF
88Making changes
89--------------
90
93f9cc67 91Modify some files, then add their updated contents to the index:
8c7fa247 92
8db9307c 93------------------------------------------------
93f9cc67 94$ git add file1 file2 file3
8db9307c 95------------------------------------------------
8c7fa247 96
93f9cc67 97You are now ready to commit. You can see what is about to be committed
ad353d7e 98using `git diff` with the `--cached` option:
93f9cc67
BF
99
100------------------------------------------------
101$ git diff --cached
102------------------------------------------------
103
ad353d7e 104(Without `--cached`, `git diff` will show you any changes that
93f9cc67 105you've made but not yet added to the index.) You can also get a brief
ad353d7e 106summary of the situation with `git status`:
93f9cc67
BF
107
108------------------------------------------------
109$ git status
8942821e
SN
110On branch master
111Changes to be committed:
80f537f7 112 (use "git restore --staged <file>..." to unstage)
8942821e
SN
113
114 modified: file1
115 modified: file2
116 modified: file3
117
93f9cc67
BF
118------------------------------------------------
119
120If you need to make any further adjustments, do so now, and then add any
121newly modified content to the index. Finally, commit your changes with:
8c7fa247 122
927a503c 123------------------------------------------------
c1d179f8 124$ git commit
927a503c 125------------------------------------------------
f2416c27 126
2feaf4e9 127This will again prompt you for a message describing the change, and then
93f9cc67 128record a new version of the project.
84dee6bb 129
ad353d7e 130Alternatively, instead of running `git add` beforehand, you can use
66589230
JH
131
132------------------------------------------------
133$ git commit -a
134------------------------------------------------
8c7fa247 135
93f9cc67
BF
136which will automatically notice any modified (but not new) files, add
137them to the index, and commit, all in one step.
84dee6bb 138
927a503c 139A note on commit messages: Though not required, it's a good idea to
1627e6b4
XZ
140begin the commit message with a single short (no more than 50
141characters) line summarizing the change, followed by a blank line and
142then a more thorough description. The text up to the first blank line in
143a commit message is treated as the commit title, and that title is used
2de9b711 144throughout Git. For example, linkgit:git-format-patch[1] turns a
52ffe995
JW
145commit into email, and it uses the title on the Subject line and the
146rest of the commit in the body.
8c7fa247 147
366bfcb6
NP
148Git tracks content not files
149----------------------------
150
483bc4f0
JN
151Many revision control systems provide an `add` command that tells the
152system to start tracking changes to a new file. Git's `add` command
ad353d7e 153does something simpler and more powerful: `git add` is used both for new
93f9cc67
BF
154and newly modified files, and in both cases it takes a snapshot of the
155given files and stages that content in the index, ready for inclusion in
156the next commit.
8c7fa247 157
23c9ccb2
BF
158Viewing project history
159-----------------------
8c7fa247 160
927a503c 161At any point you can view the history of your changes using
8c7fa247 162
927a503c 163------------------------------------------------
67e6e5c4 164$ git log
927a503c 165------------------------------------------------
8c7fa247 166
927a503c 167If you also want to see complete diffs at each step, use
8c7fa247 168
927a503c 169------------------------------------------------
67e6e5c4 170$ git log -p
927a503c 171------------------------------------------------
8c7fa247 172
c1d179f8
JH
173Often the overview of the change is useful to get a feel of
174each step
175
176------------------------------------------------
177$ git log --stat --summary
178------------------------------------------------
179
927a503c
BF
180Managing branches
181-----------------
2a29da7c 182
2de9b711 183A single Git repository can maintain multiple branches of
ad353d7e 184development. To create a new branch named `experimental`, use
8c7fa247 185
927a503c
BF
186------------------------------------------------
187$ git branch experimental
188------------------------------------------------
8c7fa247 189
927a503c 190If you now run
8c7fa247 191
927a503c
BF
192------------------------------------------------
193$ git branch
194------------------------------------------------
8c7fa247 195
927a503c 196you'll get a list of all existing branches:
8c7fa247 197
8db9307c 198------------------------------------------------
927a503c
BF
199 experimental
200* master
8db9307c 201------------------------------------------------
8c7fa247 202
ad353d7e
203The `experimental` branch is the one you just created, and the
204`master` branch is a default branch that was created for you
927a503c
BF
205automatically. The asterisk marks the branch you are currently on;
206type
8c7fa247 207
927a503c 208------------------------------------------------
328c6cb8 209$ git switch experimental
927a503c 210------------------------------------------------
8c7fa247 211
ad353d7e
212to switch to the `experimental` branch. Now edit a file, commit the
213change, and switch back to the `master` branch:
8c7fa247 214
927a503c
BF
215------------------------------------------------
216(edit file)
217$ git commit -a
328c6cb8 218$ git switch master
927a503c 219------------------------------------------------
8c7fa247 220
927a503c 221Check that the change you made is no longer visible, since it was
ad353d7e 222made on the `experimental` branch and you're back on the `master` branch.
8c7fa247 223
ad353d7e 224You can make a different change on the `master` branch:
8c7fa247 225
927a503c
BF
226------------------------------------------------
227(edit file)
228$ git commit -a
229------------------------------------------------
8c7fa247 230
927a503c 231at this point the two branches have diverged, with different changes
ad353d7e 232made in each. To merge the changes made in `experimental` into `master`, run
ed616049 233
927a503c 234------------------------------------------------
c14261ea 235$ git merge experimental
927a503c
BF
236------------------------------------------------
237
238If the changes don't conflict, you're done. If there are conflicts,
239markers will be left in the problematic files showing the conflict;
8c7fa247 240
8db9307c 241------------------------------------------------
927a503c 242$ git diff
8db9307c 243------------------------------------------------
8c7fa247 244
927a503c
BF
245will show this. Once you've edited the files to resolve the
246conflicts,
8c7fa247 247
8db9307c 248------------------------------------------------
927a503c 249$ git commit -a
8db9307c 250------------------------------------------------
8c7fa247 251
927a503c 252will commit the result of the merge. Finally,
8c7fa247 253
8db9307c 254------------------------------------------------
927a503c 255$ gitk
8db9307c 256------------------------------------------------
8c7fa247 257
927a503c 258will show a nice graphical representation of the resulting history.
8c7fa247 259
ad353d7e 260At this point you could delete the `experimental` branch with
9c9410e1
SB
261
262------------------------------------------------
263$ git branch -d experimental
264------------------------------------------------
265
ad353d7e 266This command ensures that the changes in the `experimental` branch are
9c9410e1
SB
267already in the current branch.
268
ad353d7e 269If you develop on a branch `crazy-idea`, then regret it, you can always
927a503c 270delete the branch with
8c7fa247 271
927a503c
BF
272-------------------------------------
273$ git branch -D crazy-idea
274-------------------------------------
8c7fa247 275
927a503c
BF
276Branches are cheap and easy, so this is a good way to try something
277out.
8c7fa247 278
2de9b711 279Using Git for collaboration
927a503c 280---------------------------
3eb5128a 281
2de9b711 282Suppose that Alice has started a new project with a Git repository in
ad353d7e 283`/home/alice/project`, and that Bob, who has a home directory on the
927a503c 284same machine, wants to contribute.
3eb5128a 285
927a503c 286Bob begins with:
3eb5128a 287
8db9307c 288------------------------------------------------
5d5e88af 289bob$ git clone /home/alice/project myrepo
8db9307c 290------------------------------------------------
3eb5128a 291
ad353d7e 292This creates a new directory `myrepo` containing a clone of Alice's
927a503c 293repository. The clone is on an equal footing with the original
abda1ef5 294project, possessing its own copy of the original project's history.
927a503c
BF
295
296Bob then makes some changes and commits them:
ed616049 297
927a503c
BF
298------------------------------------------------
299(edit files)
5d5e88af 300bob$ git commit -a
927a503c
BF
301(repeat as necessary)
302------------------------------------------------
ed616049 303
927a503c 304When he's ready, he tells Alice to pull changes from the repository
ad353d7e 305at `/home/bob/myrepo`. She does this with:
ed616049 306
927a503c 307------------------------------------------------
5d5e88af
IK
308alice$ cd /home/alice/project
309alice$ git pull /home/bob/myrepo master
927a503c 310------------------------------------------------
ed616049 311
ad353d7e 312This merges the changes from Bob's `master` branch into Alice's
93ee7823 313current branch. If Alice has made her own changes in the meantime,
c30e5673 314then she may need to manually fix any conflicts.
2ae6c706 315
ad353d7e 316The `pull` command thus performs two operations: it fetches changes
93ee7823 317from a remote branch, then merges them into the current branch.
2ae6c706 318
dc29bc8b 319Note that in general, Alice would want her local changes committed before
ad353d7e 320initiating this `pull`. If Bob's work conflicts with what Alice did since
dc29bc8b
JH
321their histories forked, Alice will use her working tree and the index to
322resolve conflicts, and existing local changes will interfere with the
2de9b711 323conflict resolution process (Git will still perform the fetch but will
f0b92247 324refuse to merge -- Alice will have to get rid of her local changes in
dc29bc8b
JH
325some way and pull again when this happens).
326
ad353d7e 327Alice can peek at what Bob did without merging first, using the `fetch`
dc29bc8b 328command; this allows Alice to inspect what Bob did, using a special
ad353d7e 329symbol `FETCH_HEAD`, in order to determine if he has anything worth
dc29bc8b
JH
330pulling, like this:
331
332------------------------------------------------
333alice$ git fetch /home/bob/myrepo master
53d1589f 334alice$ git log -p HEAD..FETCH_HEAD
dc29bc8b
JH
335------------------------------------------------
336
337This operation is safe even if Alice has uncommitted local changes.
ad353d7e
338The range notation `HEAD..FETCH_HEAD` means "show everything that is reachable
339from the `FETCH_HEAD` but exclude anything that is reachable from `HEAD`".
340Alice already knows everything that leads to her current state (`HEAD`),
341and reviews what Bob has in his state (`FETCH_HEAD`) that she has not
21d777f2 342seen with this command.
53d1589f
PC
343
344If Alice wants to visualize what Bob did since their histories forked
345she can issue the following command:
346
347------------------------------------------------
348$ gitk HEAD..FETCH_HEAD
349------------------------------------------------
350
ad353d7e 351This uses the same two-dot range notation we saw earlier with `git log`.
53d1589f
PC
352
353Alice may want to view what both of them did since they forked.
354She can use three-dot form instead of the two-dot form:
355
356------------------------------------------------
357$ gitk HEAD...FETCH_HEAD
358------------------------------------------------
359
360This means "show everything that is reachable from either one, but
361exclude anything that is reachable from both of them".
362
ad353d7e
363Please note that these range notation can be used with both `gitk`
364and `git log`.
dc29bc8b
JH
365
366After inspecting what Bob did, if there is nothing urgent, Alice may
367decide to continue working without pulling from Bob. If Bob's history
368does have something Alice would immediately need, Alice may choose to
ad353d7e 369stash her work-in-progress first, do a `pull`, and then finally unstash
dc29bc8b
JH
370her work-in-progress on top of the resulting history.
371
c1ff284a
JH
372When you are working in a small closely knit group, it is not
373unusual to interact with the same repository over and over
374again. By defining 'remote' repository shorthand, you can make
375it easier:
376
377------------------------------------------------
5d5e88af 378alice$ git remote add bob /home/bob/myrepo
c1ff284a
JH
379------------------------------------------------
380
ad353d7e
381With this, Alice can perform the first part of the `pull` operation
382alone using the `git fetch` command without merging them with her own
21d777f2 383branch, using:
2a29da7c 384
927a503c 385-------------------------------------
5d5e88af 386alice$ git fetch bob
927a503c 387-------------------------------------
2a29da7c 388
c1ff284a 389Unlike the longhand form, when Alice fetches from Bob using a
ad353d7e 390remote repository shorthand set up with `git remote`, what was
0e615b25 391fetched is stored in a remote-tracking branch, in this case
c1ff284a 392`bob/master`. So after this:
a7333f9e 393
927a503c 394-------------------------------------
5d5e88af 395alice$ git log -p master..bob/master
927a503c 396-------------------------------------
a7333f9e 397
927a503c 398shows a list of all the changes that Bob made since he branched from
ad353d7e 399Alice's `master` branch.
a7333f9e 400
c1ff284a 401After examining those changes, Alice
ad353d7e 402could merge the changes into her `master` branch:
ed616049 403
927a503c 404-------------------------------------
5d5e88af 405alice$ git merge bob/master
927a503c 406-------------------------------------
ed616049 407
60109d0e
MM
408This `merge` can also be done by 'pulling from her own remote-tracking
409branch', like this:
93ee7823
BF
410
411-------------------------------------
5d5e88af 412alice$ git pull . remotes/bob/master
93ee7823
BF
413-------------------------------------
414
c1ff284a 415Note that git pull always merges into the current branch,
02783075 416regardless of what else is given on the command line.
93ee7823 417
927a503c 418Later, Bob can update his repo with Alice's latest changes using
ed616049 419
927a503c 420-------------------------------------
5d5e88af 421bob$ git pull
927a503c 422-------------------------------------
ed616049 423
927a503c 424Note that he doesn't need to give the path to Alice's repository;
2de9b711 425when Bob cloned Alice's repository, Git stored the location of her
d66409f0
BF
426repository in the repository configuration, and that location is
427used for pulls:
2a29da7c 428
927a503c 429-------------------------------------
5d5e88af 430bob$ git config --get remote.origin.url
8960b5a7 431/home/alice/project
927a503c 432-------------------------------------
2a29da7c 433
ad353d7e 434(The complete configuration created by `git clone` is visible using
483bc4f0 435`git config -l`, and the linkgit:git-config[1] man page
d66409f0
BF
436explains the meaning of each option.)
437
ad353d7e
438Git also keeps a pristine copy of Alice's `master` branch under the
439name `origin/master`:
d66409f0
BF
440
441-------------------------------------
5d5e88af 442bob$ git branch -r
d66409f0
BF
443 origin/master
444-------------------------------------
2a29da7c 445
927a503c
BF
446If Bob later decides to work from a different host, he can still
447perform clones and pulls using the ssh protocol:
2a29da7c 448
927a503c 449-------------------------------------
5d5e88af 450bob$ git clone alice.org:/home/alice/project myrepo
927a503c 451-------------------------------------
2a29da7c 452
0d0bac67 453Alternatively, Git has a native protocol, or can use http;
5162e697 454see linkgit:git-pull[1] for details.
0c04094b 455
927a503c 456Git can also be used in a CVS-like mode, with a central repository
5162e697 457that various users push changes to; see linkgit:git-push[1] and
6998e4db 458linkgit:gitcvs-migration[7].
0c04094b 459
f1fe3846
BF
460Exploring history
461-----------------
0c04094b 462
f1fe3846 463Git history is represented as a series of interrelated commits. We
ad353d7e
464have already seen that the `git log` command can list those commits.
465Note that first line of each `git log` entry also gives a name for the
f1fe3846 466commit:
c9517341 467
927a503c 468-------------------------------------
f1fe3846
BF
469$ git log
470commit c82a22c39cbc32576f64f5c6b3f24b99ea8149c7
471Author: Junio C Hamano <junkio@cox.net>
472Date: Tue May 16 17:18:22 2006 -0700
473
474 merge-base: Clarify the comments on post processing.
927a503c 475-------------------------------------
0c04094b 476
ad353d7e 477We can give this name to `git show` to see the details about this
f1fe3846 478commit.
0c04094b 479
927a503c 480-------------------------------------
f1fe3846 481$ git show c82a22c39cbc32576f64f5c6b3f24b99ea8149c7
927a503c 482-------------------------------------
0c04094b 483
c1d179f8 484But there are other ways to refer to commits. You can use any initial
f1fe3846 485part of the name that is long enough to uniquely identify the commit:
0c04094b 486
f1fe3846
BF
487-------------------------------------
488$ git show c82a22c39c # the first few characters of the name are
489 # usually enough
490$ git show HEAD # the tip of the current branch
491$ git show experimental # the tip of the "experimental" branch
492-------------------------------------
493
9c9410e1
SB
494Every commit usually has one "parent" commit
495which points to the previous state of the project:
0c04094b 496
927a503c 497-------------------------------------
f1fe3846
BF
498$ git show HEAD^ # to see the parent of HEAD
499$ git show HEAD^^ # to see the grandparent of HEAD
500$ git show HEAD~4 # to see the great-great grandparent of HEAD
927a503c 501-------------------------------------
e7c1ca42 502
f1fe3846
BF
503Note that merge commits may have more than one parent:
504
505-------------------------------------
506$ git show HEAD^1 # show the first parent of HEAD (same as HEAD^)
507$ git show HEAD^2 # show the second parent of HEAD
508-------------------------------------
44760f1d 509
f1fe3846 510You can also give commits names of your own; after running
3eb5128a 511
927a503c 512-------------------------------------
b1889c36 513$ git tag v2.5 1b2e1d63ff
927a503c 514-------------------------------------
3eb5128a 515
ad353d7e 516you can refer to `1b2e1d63ff` by the name `v2.5`. If you intend to
f1fe3846
BF
517share this name with other people (for example, to identify a release
518version), you should create a "tag" object, and perhaps sign it; see
5162e697 519linkgit:git-tag[1] for details.
f1fe3846 520
2de9b711 521Any Git command that needs to know a commit can take any of these
f1fe3846 522names. For example:
3eb5128a 523
927a503c 524-------------------------------------
f1fe3846
BF
525$ git diff v2.5 HEAD # compare the current HEAD to v2.5
526$ git branch stable v2.5 # start a new branch named "stable" based
527 # at v2.5
528$ git reset --hard HEAD^ # reset your current branch and working
37425065 529 # directory to its state at HEAD^
927a503c 530-------------------------------------
c9517341 531
f1fe3846
BF
532Be careful with that last command: in addition to losing any changes
533in the working directory, it will also remove all later commits from
534this branch. If this branch is the only branch containing those
ad353d7e 535commits, they will be lost. Also, don't use `git reset` on a
a9d1836b
JH
536publicly-visible branch that other developers pull from, as it will
537force needless merges on other developers to clean up the history.
ad353d7e 538If you need to undo changes that you have pushed, use `git revert`
6e2e1cfb 539instead.
c9517341 540
ad353d7e 541The `git grep` command can search for strings in any version of your
f1fe3846 542project, so
c9517341 543
927a503c 544-------------------------------------
f1fe3846 545$ git grep "hello" v2.5
927a503c 546-------------------------------------
c9517341 547
ad353d7e 548searches for all occurrences of "hello" in `v2.5`.
2a29da7c 549
ad353d7e 550If you leave out the commit name, `git grep` will search any of the
f1fe3846 551files it manages in your current directory. So
2a29da7c 552
927a503c 553-------------------------------------
f1fe3846 554$ git grep "hello"
dc5f9239
JH
555-------------------------------------
556
2de9b711 557is a quick way to search just the files that are tracked by Git.
927a503c 558
2de9b711 559Many Git commands also take sets of commits, which can be specified
ad353d7e 560in a number of ways. Here are some examples with `git log`:
927a503c
BF
561
562-------------------------------------
f1fe3846
BF
563$ git log v2.5..v2.6 # commits between v2.5 and v2.6
564$ git log v2.5.. # commits since v2.5
565$ git log --since="2 weeks ago" # commits from the last 2 weeks
566$ git log v2.5.. Makefile # commits since v2.5 which modify
567 # Makefile
927a503c 568-------------------------------------
6f60300b 569
ad353d7e 570You can also give `git log` a "range" of commits where the first is not
f1fe3846 571necessarily an ancestor of the second; for example, if the tips of
ad353d7e 572the branches `stable` and `master` diverged from a common
f1fe3846
BF
573commit some time ago, then
574
575-------------------------------------
21d777f2 576$ git log stable..master
f1fe3846
BF
577-------------------------------------
578
ad353d7e 579will list commits made in the `master` branch but not in the
f1fe3846
BF
580stable branch, while
581
582-------------------------------------
21d777f2 583$ git log master..stable
f1fe3846
BF
584-------------------------------------
585
586will show the list of commits made on the stable branch but not
ad353d7e 587the `master` branch.
f1fe3846 588
ad353d7e 589The `git log` command has a weakness: it must present commits in a
f1fe3846 590list. When the history has lines of development that diverged and
ad353d7e 591then merged back together, the order in which `git log` presents
f1fe3846
BF
592those commits is meaningless.
593
c7719fbe 594Most projects with multiple contributors (such as the Linux kernel,
ad353d7e 595or Git itself) have frequent merges, and `gitk` does a better job of
f1fe3846
BF
596visualizing their history. For example,
597
598-------------------------------------
599$ gitk --since="2 weeks ago" drivers/
600-------------------------------------
601
602allows you to browse any commits from the last 2 weeks of commits
ad353d7e 603that modified files under the `drivers` directory. (Note: you can
2be1bc48
BF
604adjust gitk's fonts by holding down the control key while pressing
605"-" or "+".)
f1fe3846
BF
606
607Finally, most commands that take filenames will optionally allow you
608to precede any filename by a commit, to specify a particular version
38573864 609of the file:
f1fe3846
BF
610
611-------------------------------------
612$ git diff v2.5:Makefile HEAD:Makefile.in
613-------------------------------------
927a503c 614
ad353d7e 615You can also use `git show` to see any such file:
38573864
BF
616
617-------------------------------------
9c9410e1 618$ git show v2.5:Makefile
38573864
BF
619-------------------------------------
620
927a503c
BF
621Next Steps
622----------
623
e31952da
BF
624This tutorial should be enough to perform basic distributed revision
625control for your projects. However, to fully understand the depth
2de9b711 626and power of Git you need to understand two simple ideas on which it
e31952da
BF
627is based:
628
629 * The object database is the rather elegant system used to
630 store the history of your project--files, directories, and
631 commits.
632
633 * The index file is a cache of the state of a directory tree,
634 used to create commits, check out working directories, and
635 hold the various trees involved in a merge.
636
6998e4db 637Part two of this tutorial explains the object
e31952da 638database, the index file, and a few other odds and ends that you'll
2de9b711 639need to make the most of Git. You can find it at linkgit:gittutorial-2[7].
e31952da 640
cd50aba9 641If you don't want to continue with that right away, a few other
e31952da 642digressions that may be interesting at this point are:
927a503c 643
5162e697 644 * linkgit:git-format-patch[1], linkgit:git-am[1]: These convert
927a503c 645 series of git commits into emailed patches, and vice versa,
c7719fbe 646 useful for projects such as the Linux kernel which rely heavily
927a503c
BF
647 on emailed patches.
648
5162e697 649 * linkgit:git-bisect[1]: When there is a regression in your
927a503c 650 project, one way to track down the bug is by searching through
ad353d7e 651 the history to find the exact commit that's to blame. `git bisect`
927a503c
BF
652 can help you perform a binary search for that commit. It is
653 smart enough to perform a close-to-optimal search even in the
654 case of complex non-linear history with lots of merged branches.
655
801a011d
TR
656 * linkgit:gitworkflows[7]: Gives an overview of recommended
657 workflows.
658
673151a9 659 * linkgit:giteveryday[7]: Everyday Git with 20 Commands Or So.
e31952da 660
6998e4db 661 * linkgit:gitcvs-migration[7]: Git for CVS users.
b27a23e3
CC
662
663SEE ALSO
664--------
665linkgit:gittutorial-2[7],
666linkgit:gitcvs-migration[7],
497c8331
CC
667linkgit:gitcore-tutorial[7],
668linkgit:gitglossary[7],
6e702c24 669linkgit:git-help[1],
801a011d 670linkgit:gitworkflows[7],
673151a9 671linkgit:giteveryday[7],
b27a23e3
CC
672link:user-manual.html[The Git User's Manual]
673
674GIT
675---
941b9c52 676Part of the linkgit:git[1] suite