]>
Commit | Line | Data |
---|---|---|
927a503c BF |
1 | A tutorial introduction to git |
2 | ============================== | |
8c7fa247 | 3 | |
927a503c BF |
4 | This tutorial explains how to import a new project into git, make |
5 | changes to it, and share changes with other developers. | |
8c7fa247 | 6 | |
927a503c BF |
7 | First, note that you can get documentation for a command such as "git |
8 | diff" with: | |
8c7fa247 | 9 | |
927a503c BF |
10 | ------------------------------------------------ |
11 | $ man git-diff | |
12 | ------------------------------------------------ | |
8c7fa247 | 13 | |
66589230 JH |
14 | It is a good idea to introduce yourself to git before doing any |
15 | operation. The easiest way to do so is: | |
16 | ||
17 | ------------------------------------------------ | |
18 | $ cat >~/.gitconfig <<\EOF | |
19 | [user] | |
20 | name = Your Name Comes Here | |
21 | email = you@yourdomain.example.com | |
22 | EOF | |
23 | ------------------------------------------------ | |
24 | ||
25 | ||
927a503c BF |
26 | Importing a new project |
27 | ----------------------- | |
8c7fa247 | 28 | |
927a503c BF |
29 | Assume you have a tarball project.tar.gz with your initial work. You |
30 | can place it under git revision control as follows. | |
8c7fa247 | 31 | |
8db9307c | 32 | ------------------------------------------------ |
dcc6e28f | 33 | $ tar xzf project.tar.gz |
927a503c BF |
34 | $ cd project |
35 | $ git init-db | |
8db9307c | 36 | ------------------------------------------------ |
8c7fa247 | 37 | |
927a503c | 38 | Git will reply |
8c7fa247 | 39 | |
927a503c | 40 | ------------------------------------------------ |
ef0a89a6 | 41 | Initialized empty Git repository in .git/ |
927a503c | 42 | ------------------------------------------------ |
8c7fa247 | 43 | |
927a503c BF |
44 | You've now initialized the working directory--you may notice a new |
45 | directory created, named ".git". Tell git that you want it to track | |
66589230 JH |
46 | every file under the current directory with (notice the dot '.' |
47 | that means the current directory): | |
8c7fa247 | 48 | |
8db9307c | 49 | ------------------------------------------------ |
927a503c | 50 | $ git add . |
8db9307c | 51 | ------------------------------------------------ |
8c7fa247 | 52 | |
927a503c | 53 | Finally, |
8c7fa247 | 54 | |
927a503c | 55 | ------------------------------------------------ |
66589230 | 56 | $ git commit |
927a503c | 57 | ------------------------------------------------ |
8c7fa247 | 58 | |
927a503c BF |
59 | will prompt you for a commit message, then record the current state |
60 | of all the files to the repository. | |
8c7fa247 | 61 | |
927a503c | 62 | Try modifying some files, then run |
8c7fa247 | 63 | |
8db9307c | 64 | ------------------------------------------------ |
927a503c | 65 | $ git diff |
8db9307c | 66 | ------------------------------------------------ |
8c7fa247 | 67 | |
927a503c | 68 | to review your changes. When you're done, |
8c7fa247 | 69 | |
927a503c | 70 | ------------------------------------------------ |
66589230 | 71 | $ git commit file1 file2... |
927a503c | 72 | ------------------------------------------------ |
f2416c27 | 73 | |
927a503c | 74 | will again prompt your for a message describing the change, and then |
66589230 JH |
75 | record the new versions of the files you listed. It is cumbersome |
76 | to list all files and you can say `-a` (which stands for 'all') | |
77 | instead. | |
78 | ||
79 | ------------------------------------------------ | |
80 | $ git commit -a | |
81 | ------------------------------------------------ | |
8c7fa247 | 82 | |
927a503c BF |
83 | A note on commit messages: Though not required, it's a good idea to |
84 | begin the commit message with a single short (less than 50 character) | |
85 | line summarizing the change, followed by a blank line and then a more | |
86 | thorough description. Tools that turn commits into email, for | |
87 | example, use the first line on the Subject line and the rest of the | |
88 | commit in the body. | |
8c7fa247 | 89 | |
8c7fa247 | 90 | |
366bfcb6 NP |
91 | Git tracks content not files |
92 | ---------------------------- | |
93 | ||
94 | With git you have to explicitly "add" all the changed _content_ you | |
95 | want to commit together. This can be done in a few different ways: | |
96 | ||
97 | 1) By using 'git add <file_spec>...' | |
98 | ||
99 | This can be performed multiple times before a commit. Note that this | |
100 | is not only for adding new files. Even modified files must be | |
101 | added to the set of changes about to be committed. The "git status" | |
102 | command gives you a summary of what is included so far for the | |
103 | next commit. When done you should use the 'git commit' command to | |
104 | make it real. | |
105 | ||
106 | Note: don't forget to 'add' a file again if you modified it after the | |
107 | first 'add' and before 'commit'. Otherwise only the previous added | |
108 | state of that file will be committed. This is because git tracks | |
109 | content, so what you're really 'add'ing to the commit is the *content* | |
110 | of the file in the state it is in when you 'add' it. | |
111 | ||
112 | 2) By using 'git commit -a' directly | |
113 | ||
114 | This is a quick way to automatically 'add' the content from all files | |
115 | that were modified since the previous commit, and perform the actual | |
116 | commit without having to separately 'add' them beforehand. This will | |
117 | not add content from new files i.e. files that were never added before. | |
118 | Those files still have to be added explicitly before performing a | |
119 | commit. | |
120 | ||
121 | But here's a twist. If you do 'git commit <file1> <file2> ...' then only | |
122 | the changes belonging to those explicitly specified files will be | |
123 | committed, entirely bypassing the current "added" changes. Those "added" | |
124 | changes will still remain available for a subsequent commit though. | |
125 | ||
126 | However, for normal usage you only have to remember 'git add' + 'git commit' | |
127 | and/or 'git commit -a'. | |
128 | ||
8c7fa247 | 129 | |
366bfcb6 NP |
130 | Viewing the changelog |
131 | --------------------- | |
8c7fa247 | 132 | |
927a503c | 133 | At any point you can view the history of your changes using |
8c7fa247 | 134 | |
927a503c | 135 | ------------------------------------------------ |
67e6e5c4 | 136 | $ git log |
927a503c | 137 | ------------------------------------------------ |
8c7fa247 | 138 | |
927a503c | 139 | If you also want to see complete diffs at each step, use |
8c7fa247 | 140 | |
927a503c | 141 | ------------------------------------------------ |
67e6e5c4 | 142 | $ git log -p |
927a503c | 143 | ------------------------------------------------ |
8c7fa247 | 144 | |
927a503c BF |
145 | Managing branches |
146 | ----------------- | |
2a29da7c | 147 | |
927a503c BF |
148 | A single git repository can maintain multiple branches of |
149 | development. To create a new branch named "experimental", use | |
8c7fa247 | 150 | |
927a503c BF |
151 | ------------------------------------------------ |
152 | $ git branch experimental | |
153 | ------------------------------------------------ | |
8c7fa247 | 154 | |
927a503c | 155 | If you now run |
8c7fa247 | 156 | |
927a503c BF |
157 | ------------------------------------------------ |
158 | $ git branch | |
159 | ------------------------------------------------ | |
8c7fa247 | 160 | |
927a503c | 161 | you'll get a list of all existing branches: |
8c7fa247 | 162 | |
8db9307c | 163 | ------------------------------------------------ |
927a503c BF |
164 | experimental |
165 | * master | |
8db9307c | 166 | ------------------------------------------------ |
8c7fa247 | 167 | |
927a503c BF |
168 | The "experimental" branch is the one you just created, and the |
169 | "master" branch is a default branch that was created for you | |
170 | automatically. The asterisk marks the branch you are currently on; | |
171 | type | |
8c7fa247 | 172 | |
927a503c BF |
173 | ------------------------------------------------ |
174 | $ git checkout experimental | |
175 | ------------------------------------------------ | |
8c7fa247 | 176 | |
927a503c BF |
177 | to switch to the experimental branch. Now edit a file, commit the |
178 | change, and switch back to the master branch: | |
8c7fa247 | 179 | |
927a503c BF |
180 | ------------------------------------------------ |
181 | (edit file) | |
182 | $ git commit -a | |
183 | $ git checkout master | |
184 | ------------------------------------------------ | |
8c7fa247 | 185 | |
927a503c BF |
186 | Check that the change you made is no longer visible, since it was |
187 | made on the experimental branch and you're back on the master branch. | |
8c7fa247 | 188 | |
927a503c | 189 | You can make a different change on the master branch: |
8c7fa247 | 190 | |
927a503c BF |
191 | ------------------------------------------------ |
192 | (edit file) | |
193 | $ git commit -a | |
194 | ------------------------------------------------ | |
8c7fa247 | 195 | |
927a503c | 196 | at this point the two branches have diverged, with different changes |
59427063 | 197 | made in each. To merge the changes made in experimental into master, run |
ed616049 | 198 | |
927a503c BF |
199 | ------------------------------------------------ |
200 | $ git pull . experimental | |
201 | ------------------------------------------------ | |
202 | ||
203 | If the changes don't conflict, you're done. If there are conflicts, | |
204 | markers will be left in the problematic files showing the conflict; | |
8c7fa247 | 205 | |
8db9307c | 206 | ------------------------------------------------ |
927a503c | 207 | $ git diff |
8db9307c | 208 | ------------------------------------------------ |
8c7fa247 | 209 | |
927a503c BF |
210 | will show this. Once you've edited the files to resolve the |
211 | conflicts, | |
8c7fa247 | 212 | |
8db9307c | 213 | ------------------------------------------------ |
927a503c | 214 | $ git commit -a |
8db9307c | 215 | ------------------------------------------------ |
8c7fa247 | 216 | |
927a503c | 217 | will commit the result of the merge. Finally, |
8c7fa247 | 218 | |
8db9307c | 219 | ------------------------------------------------ |
927a503c | 220 | $ gitk |
8db9307c | 221 | ------------------------------------------------ |
8c7fa247 | 222 | |
927a503c | 223 | will show a nice graphical representation of the resulting history. |
8c7fa247 | 224 | |
927a503c BF |
225 | If you develop on a branch crazy-idea, then regret it, you can always |
226 | delete the branch with | |
8c7fa247 | 227 | |
927a503c BF |
228 | ------------------------------------- |
229 | $ git branch -D crazy-idea | |
230 | ------------------------------------- | |
8c7fa247 | 231 | |
927a503c BF |
232 | Branches are cheap and easy, so this is a good way to try something |
233 | out. | |
8c7fa247 | 234 | |
927a503c BF |
235 | Using git for collaboration |
236 | --------------------------- | |
3eb5128a | 237 | |
927a503c BF |
238 | Suppose that Alice has started a new project with a git repository in |
239 | /home/alice/project, and that Bob, who has a home directory on the | |
240 | same machine, wants to contribute. | |
3eb5128a | 241 | |
927a503c | 242 | Bob begins with: |
3eb5128a | 243 | |
8db9307c | 244 | ------------------------------------------------ |
927a503c | 245 | $ git clone /home/alice/project myrepo |
8db9307c | 246 | ------------------------------------------------ |
3eb5128a | 247 | |
927a503c BF |
248 | This creates a new directory "myrepo" containing a clone of Alice's |
249 | repository. The clone is on an equal footing with the original | |
abda1ef5 | 250 | project, possessing its own copy of the original project's history. |
927a503c BF |
251 | |
252 | Bob then makes some changes and commits them: | |
ed616049 | 253 | |
927a503c BF |
254 | ------------------------------------------------ |
255 | (edit files) | |
256 | $ git commit -a | |
257 | (repeat as necessary) | |
258 | ------------------------------------------------ | |
ed616049 | 259 | |
927a503c BF |
260 | When he's ready, he tells Alice to pull changes from the repository |
261 | at /home/bob/myrepo. She does this with: | |
ed616049 | 262 | |
927a503c BF |
263 | ------------------------------------------------ |
264 | $ cd /home/alice/project | |
93ee7823 | 265 | $ git pull /home/bob/myrepo master |
927a503c | 266 | ------------------------------------------------ |
ed616049 | 267 | |
93ee7823 BF |
268 | This merges the changes from Bob's "master" branch into Alice's |
269 | current branch. If Alice has made her own changes in the meantime, | |
270 | then she may need to manually fix any conflicts. (Note that the | |
271 | "master" argument in the above command is actually unnecessary, as it | |
272 | is the default.) | |
2ae6c706 | 273 | |
93ee7823 BF |
274 | The "pull" command thus performs two operations: it fetches changes |
275 | from a remote branch, then merges them into the current branch. | |
2ae6c706 | 276 | |
93ee7823 BF |
277 | You can perform the first operation alone using the "git fetch" |
278 | command. For example, Alice could create a temporary branch just to | |
279 | track Bob's changes, without merging them with her own, using: | |
2a29da7c | 280 | |
927a503c BF |
281 | ------------------------------------- |
282 | $ git fetch /home/bob/myrepo master:bob-incoming | |
283 | ------------------------------------- | |
2a29da7c | 284 | |
927a503c | 285 | which fetches the changes from Bob's master branch into a new branch |
93ee7823 | 286 | named bob-incoming. Then |
a7333f9e | 287 | |
927a503c | 288 | ------------------------------------- |
67e6e5c4 | 289 | $ git log -p master..bob-incoming |
927a503c | 290 | ------------------------------------- |
a7333f9e | 291 | |
927a503c BF |
292 | shows a list of all the changes that Bob made since he branched from |
293 | Alice's master branch. | |
a7333f9e | 294 | |
93ee7823 BF |
295 | After examining those changes, and possibly fixing things, Alice |
296 | could pull the changes into her master branch: | |
ed616049 | 297 | |
927a503c BF |
298 | ------------------------------------- |
299 | $ git checkout master | |
300 | $ git pull . bob-incoming | |
301 | ------------------------------------- | |
ed616049 | 302 | |
927a503c BF |
303 | The last command is a pull from the "bob-incoming" branch in Alice's |
304 | own repository. | |
ed616049 | 305 | |
93ee7823 BF |
306 | Alice could also perform both steps at once with: |
307 | ||
308 | ------------------------------------- | |
309 | $ git pull /home/bob/myrepo master:bob-incoming | |
310 | ------------------------------------- | |
311 | ||
312 | This is just like the "git pull /home/bob/myrepo master" that we saw | |
313 | before, except that it also stores the unmerged changes from bob's | |
314 | master branch in bob-incoming before merging them into Alice's | |
315 | current branch. Note that git pull always merges into the current | |
316 | branch, regardless of what else is given on the commandline. | |
317 | ||
927a503c | 318 | Later, Bob can update his repo with Alice's latest changes using |
ed616049 | 319 | |
927a503c BF |
320 | ------------------------------------- |
321 | $ git pull | |
322 | ------------------------------------- | |
ed616049 | 323 | |
927a503c BF |
324 | Note that he doesn't need to give the path to Alice's repository; |
325 | when Bob cloned Alice's repository, git stored the location of her | |
d66409f0 BF |
326 | repository in the repository configuration, and that location is |
327 | used for pulls: | |
2a29da7c | 328 | |
927a503c | 329 | ------------------------------------- |
d66409f0 BF |
330 | $ git repo-config --get remote.origin.url |
331 | /home/bob/myrepo | |
927a503c | 332 | ------------------------------------- |
2a29da7c | 333 | |
d66409f0 BF |
334 | (The complete configuration created by git-clone is visible using |
335 | "git repo-config -l", and the gitlink:git-repo-config[1] man page | |
336 | explains the meaning of each option.) | |
337 | ||
338 | Git also keeps a pristine copy of Alice's master branch under the | |
339 | name "origin/master": | |
340 | ||
341 | ------------------------------------- | |
342 | $ git branch -r | |
343 | origin/master | |
344 | ------------------------------------- | |
2a29da7c | 345 | |
927a503c BF |
346 | If Bob later decides to work from a different host, he can still |
347 | perform clones and pulls using the ssh protocol: | |
2a29da7c | 348 | |
927a503c BF |
349 | ------------------------------------- |
350 | $ git clone alice.org:/home/alice/project myrepo | |
351 | ------------------------------------- | |
2a29da7c | 352 | |
927a503c BF |
353 | Alternatively, git has a native protocol, or can use rsync or http; |
354 | see gitlink:git-pull[1] for details. | |
0c04094b | 355 | |
927a503c BF |
356 | Git can also be used in a CVS-like mode, with a central repository |
357 | that various users push changes to; see gitlink:git-push[1] and | |
358 | link:cvs-migration.html[git for CVS users]. | |
0c04094b | 359 | |
f1fe3846 BF |
360 | Exploring history |
361 | ----------------- | |
0c04094b | 362 | |
f1fe3846 BF |
363 | Git history is represented as a series of interrelated commits. We |
364 | have already seen that the git log command can list those commits. | |
365 | Note that first line of each git log entry also gives a name for the | |
366 | commit: | |
c9517341 | 367 | |
927a503c | 368 | ------------------------------------- |
f1fe3846 BF |
369 | $ git log |
370 | commit c82a22c39cbc32576f64f5c6b3f24b99ea8149c7 | |
371 | Author: Junio C Hamano <junkio@cox.net> | |
372 | Date: Tue May 16 17:18:22 2006 -0700 | |
373 | ||
374 | merge-base: Clarify the comments on post processing. | |
927a503c | 375 | ------------------------------------- |
0c04094b | 376 | |
f1fe3846 BF |
377 | We can give this name to git show to see the details about this |
378 | commit. | |
0c04094b | 379 | |
927a503c | 380 | ------------------------------------- |
f1fe3846 | 381 | $ git show c82a22c39cbc32576f64f5c6b3f24b99ea8149c7 |
927a503c | 382 | ------------------------------------- |
0c04094b | 383 | |
f1fe3846 BF |
384 | But there other ways to refer to commits. You can use any initial |
385 | part of the name that is long enough to uniquely identify the commit: | |
0c04094b | 386 | |
f1fe3846 BF |
387 | ------------------------------------- |
388 | $ git show c82a22c39c # the first few characters of the name are | |
389 | # usually enough | |
390 | $ git show HEAD # the tip of the current branch | |
391 | $ git show experimental # the tip of the "experimental" branch | |
392 | ------------------------------------- | |
393 | ||
394 | Every commit has at least one "parent" commit, which points to the | |
395 | previous state of the project: | |
0c04094b | 396 | |
927a503c | 397 | ------------------------------------- |
f1fe3846 BF |
398 | $ git show HEAD^ # to see the parent of HEAD |
399 | $ git show HEAD^^ # to see the grandparent of HEAD | |
400 | $ git show HEAD~4 # to see the great-great grandparent of HEAD | |
927a503c | 401 | ------------------------------------- |
e7c1ca42 | 402 | |
f1fe3846 BF |
403 | Note that merge commits may have more than one parent: |
404 | ||
405 | ------------------------------------- | |
406 | $ git show HEAD^1 # show the first parent of HEAD (same as HEAD^) | |
407 | $ git show HEAD^2 # show the second parent of HEAD | |
408 | ------------------------------------- | |
44760f1d | 409 | |
f1fe3846 | 410 | You can also give commits names of your own; after running |
3eb5128a | 411 | |
927a503c | 412 | ------------------------------------- |
f1fe3846 | 413 | $ git-tag v2.5 1b2e1d63ff |
927a503c | 414 | ------------------------------------- |
3eb5128a | 415 | |
f1fe3846 BF |
416 | you can refer to 1b2e1d63ff by the name "v2.5". If you intend to |
417 | share this name with other people (for example, to identify a release | |
418 | version), you should create a "tag" object, and perhaps sign it; see | |
419 | gitlink:git-tag[1] for details. | |
420 | ||
421 | Any git command that needs to know a commit can take any of these | |
422 | names. For example: | |
3eb5128a | 423 | |
927a503c | 424 | ------------------------------------- |
f1fe3846 BF |
425 | $ git diff v2.5 HEAD # compare the current HEAD to v2.5 |
426 | $ git branch stable v2.5 # start a new branch named "stable" based | |
427 | # at v2.5 | |
428 | $ git reset --hard HEAD^ # reset your current branch and working | |
37425065 | 429 | # directory to its state at HEAD^ |
927a503c | 430 | ------------------------------------- |
c9517341 | 431 | |
f1fe3846 BF |
432 | Be careful with that last command: in addition to losing any changes |
433 | in the working directory, it will also remove all later commits from | |
434 | this branch. If this branch is the only branch containing those | |
435 | commits, they will be lost. (Also, don't use "git reset" on a | |
436 | publicly-visible branch that other developers pull from, as git will | |
437 | be confused by history that disappears in this way.) | |
c9517341 | 438 | |
f1fe3846 BF |
439 | The git grep command can search for strings in any version of your |
440 | project, so | |
c9517341 | 441 | |
927a503c | 442 | ------------------------------------- |
f1fe3846 | 443 | $ git grep "hello" v2.5 |
927a503c | 444 | ------------------------------------- |
c9517341 | 445 | |
abda1ef5 | 446 | searches for all occurrences of "hello" in v2.5. |
2a29da7c | 447 | |
f1fe3846 BF |
448 | If you leave out the commit name, git grep will search any of the |
449 | files it manages in your current directory. So | |
2a29da7c | 450 | |
927a503c | 451 | ------------------------------------- |
f1fe3846 | 452 | $ git grep "hello" |
dc5f9239 JH |
453 | ------------------------------------- |
454 | ||
f1fe3846 | 455 | is a quick way to search just the files that are tracked by git. |
927a503c | 456 | |
f1fe3846 BF |
457 | Many git commands also take sets of commits, which can be specified |
458 | in a number of ways. Here are some examples with git log: | |
927a503c BF |
459 | |
460 | ------------------------------------- | |
f1fe3846 BF |
461 | $ git log v2.5..v2.6 # commits between v2.5 and v2.6 |
462 | $ git log v2.5.. # commits since v2.5 | |
463 | $ git log --since="2 weeks ago" # commits from the last 2 weeks | |
464 | $ git log v2.5.. Makefile # commits since v2.5 which modify | |
465 | # Makefile | |
927a503c | 466 | ------------------------------------- |
6f60300b | 467 | |
f1fe3846 BF |
468 | You can also give git log a "range" of commits where the first is not |
469 | necessarily an ancestor of the second; for example, if the tips of | |
470 | the branches "stable-release" and "master" diverged from a common | |
471 | commit some time ago, then | |
472 | ||
473 | ------------------------------------- | |
474 | $ git log stable..experimental | |
475 | ------------------------------------- | |
476 | ||
477 | will list commits made in the experimental branch but not in the | |
478 | stable branch, while | |
479 | ||
480 | ------------------------------------- | |
481 | $ git log experimental..stable | |
482 | ------------------------------------- | |
483 | ||
484 | will show the list of commits made on the stable branch but not | |
485 | the experimental branch. | |
486 | ||
487 | The "git log" command has a weakness: it must present commits in a | |
488 | list. When the history has lines of development that diverged and | |
489 | then merged back together, the order in which "git log" presents | |
490 | those commits is meaningless. | |
491 | ||
492 | Most projects with multiple contributors (such as the linux kernel, | |
493 | or git itself) have frequent merges, and gitk does a better job of | |
494 | visualizing their history. For example, | |
495 | ||
496 | ------------------------------------- | |
497 | $ gitk --since="2 weeks ago" drivers/ | |
498 | ------------------------------------- | |
499 | ||
500 | allows you to browse any commits from the last 2 weeks of commits | |
2be1bc48 BF |
501 | that modified files under the "drivers" directory. (Note: you can |
502 | adjust gitk's fonts by holding down the control key while pressing | |
503 | "-" or "+".) | |
f1fe3846 BF |
504 | |
505 | Finally, most commands that take filenames will optionally allow you | |
506 | to precede any filename by a commit, to specify a particular version | |
38573864 | 507 | of the file: |
f1fe3846 BF |
508 | |
509 | ------------------------------------- | |
510 | $ git diff v2.5:Makefile HEAD:Makefile.in | |
511 | ------------------------------------- | |
927a503c | 512 | |
38573864 BF |
513 | You can also use "git cat-file -p" to see any such file: |
514 | ||
515 | ------------------------------------- | |
516 | $ git cat-file -p v2.5:Makefile | |
517 | ------------------------------------- | |
518 | ||
927a503c BF |
519 | Next Steps |
520 | ---------- | |
521 | ||
e31952da BF |
522 | This tutorial should be enough to perform basic distributed revision |
523 | control for your projects. However, to fully understand the depth | |
524 | and power of git you need to understand two simple ideas on which it | |
525 | is based: | |
526 | ||
527 | * The object database is the rather elegant system used to | |
528 | store the history of your project--files, directories, and | |
529 | commits. | |
530 | ||
531 | * The index file is a cache of the state of a directory tree, | |
532 | used to create commits, check out working directories, and | |
533 | hold the various trees involved in a merge. | |
534 | ||
535 | link:tutorial-2.html[Part two of this tutorial] explains the object | |
536 | database, the index file, and a few other odds and ends that you'll | |
537 | need to make the most of git. | |
538 | ||
539 | If you don't want to consider with that right away, a few other | |
540 | digressions that may be interesting at this point are: | |
927a503c | 541 | |
927a503c BF |
542 | * gitlink:git-format-patch[1], gitlink:git-am[1]: These convert |
543 | series of git commits into emailed patches, and vice versa, | |
544 | useful for projects such as the linux kernel which rely heavily | |
545 | on emailed patches. | |
546 | ||
547 | * gitlink:git-bisect[1]: When there is a regression in your | |
548 | project, one way to track down the bug is by searching through | |
549 | the history to find the exact commit that's to blame. Git bisect | |
550 | can help you perform a binary search for that commit. It is | |
551 | smart enough to perform a close-to-optimal search even in the | |
552 | case of complex non-linear history with lots of merged branches. | |
553 | ||
abda1ef5 | 554 | * link:everyday.html[Everyday GIT with 20 Commands Or So] |
e31952da BF |
555 | |
556 | * link:cvs-migration.html[git for CVS users]. |