3 "introduction": "Test your knowledge of the Git version control system.",
6 "class": "ScriptQuestion",
8 "id": "git help config",
9 "prompt": "Get help for Git's `config` command",
10 "answer": "git help config",
11 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-help.html",
17 "class": "ScriptQuestion",
19 "id": "git config --global user.name",
20 "prompt": "Configure your user-wide name to be `A U Thor`.",
21 "answer": "git config --global user.name 'A U Thor'",
28 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
34 "class": "ScriptQuestion",
36 "id": "git config --global user.email",
37 "prompt": "Configure your user-wide email to be `author@example.com`.",
38 "answer": "git config --global user.email 'author@example.com'",
45 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
51 "class": "ScriptQuestion",
54 "prompt": "Initialize a Git repository in a new `my-project` directory.",
64 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-init.html",
70 "class": "ScriptQuestion",
73 "prompt": "Clone git://github.com/wking/quizzer.git into a new `quizzer` directory.",
74 "answer": "git clone git://github.com/wking/quizzer.git",
79 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html",
85 "class": "ScriptQuestion",
87 "id": "git add / commit",
89 "There is a new README file in your repository.",
90 "Make a new commit including this README.",
91 "The commit message should be `Add a README`."
97 "git commit -m 'Add a README'"
100 "export GIT_AUTHOR_NAME='A U Thor'",
101 "export GIT_AUTHOR_EMAIL=author@example.com",
102 "export GIT_COMMITTER_NAME='C O Mitter'",
103 "export GIT_COMMITTER_EMAIL=committer@example.com",
104 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
105 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
107 "echo 'This project is wonderful' > README"
114 "http://www.kernel.org/pub/software/scm/git/docs/git-add.html",
115 "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html"
123 "class": "ScriptQuestion",
127 "You don't remember if you've staged README to be committed.",
128 "How would you check?"
130 "answer": "git status",
133 "echo 'This project is wonderful' > README",
136 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-status.html",
143 "class": "ScriptQuestion",
145 "id": "git commit -a",
147 "You've edited a few files since the last commit.",
148 "Make a new commit including all of these changes.",
149 "The commit message should be `Reformat widgets`."
152 "answer": "git commit -am 'Reformat widgets'",
154 "export GIT_AUTHOR_NAME='A U Thor'",
155 "export GIT_AUTHOR_EMAIL=author@example.com",
156 "export GIT_COMMITTER_NAME='C O Mitter'",
157 "export GIT_COMMITTER_EMAIL=committer@example.com",
158 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
159 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
161 "echo 'This project is wonderful' > README",
162 "echo 'Lots of widgets' > widgets",
163 "git add README widgets",
164 "git commit -m 'Add some widgets'",
165 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
166 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
167 "echo 'Take a look in the widgets file.' >> README",
168 "echo 'Widget-1 should be blue' >> widgets"
173 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
179 "class": "ScriptQuestion",
181 "id": "git rm / commit",
183 "You've had a `widgets` file in your repository for a few commits,",
184 "but you don't need it any more.",
185 "Create a commit removing the file.",
186 "The commit message should be `Remove 'widgets'`."
192 "git commit -am \"Remove 'widgets'\""
195 "export GIT_AUTHOR_NAME='A U Thor'",
196 "export GIT_AUTHOR_EMAIL=author@example.com",
197 "export GIT_COMMITTER_NAME='C O Mitter'",
198 "export GIT_COMMITTER_EMAIL=committer@example.com",
199 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
200 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
202 "echo 'Lots of widgets' > widgets",
204 "git commit -m 'Add some widgets'",
205 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
206 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\""
212 "http://www.kernel.org/pub/software/scm/git/docs/git-rm.html",
213 "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html"
221 "class": "ScriptQuestion",
225 "You've edited a few files since the last commit.",
226 "Ask Git to display the changes you've make (but not staged)."
228 "answer": "git diff",
230 "export GIT_AUTHOR_NAME='A U Thor'",
231 "export GIT_AUTHOR_EMAIL=author@example.com",
232 "export GIT_COMMITTER_NAME='C O Mitter'",
233 "export GIT_COMMITTER_EMAIL=committer@example.com",
234 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
235 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
237 "echo 'This project is wonderful' > README",
238 "echo 'Lots of widgets' > widgets",
239 "git add README widgets",
240 "git commit -m 'Add some widgets'",
241 "echo 'Take a look in the widgets file.' >> README",
242 "echo 'Widget-1 should be blue' >> widgets"
244 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-diff.html",
250 "class": "ScriptQuestion",
252 "id": "git diff HEAD --",
254 "You've edited a few files since the last commit.",
255 "Ask Git to display the changes you've make since the last commit,",
256 "including any changes that you may have already staged."
258 "answer": "git diff HEAD --",
260 "export GIT_AUTHOR_NAME='A U Thor'",
261 "export GIT_AUTHOR_EMAIL=author@example.com",
262 "export GIT_COMMITTER_NAME='C O Mitter'",
263 "export GIT_COMMITTER_EMAIL=committer@example.com",
264 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
265 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
267 "echo 'This project is wonderful' > README",
268 "echo 'Lots of widgets' > widgets",
269 "git add README widgets",
270 "git commit -m 'Add some widgets'",
271 "echo 'Take a look in the widgets file.' >> README",
272 "echo 'Widget-1 should be blue' >> widgets",
275 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-diff.html",
281 "class": "ScriptQuestion",
283 "id": "git diff HEAD -- README",
285 "You've edited a few files since the last commit.",
286 "Ask Git to display the changes you've make to README since the last commit,",
287 "including any changes that you may have already staged."
289 "answer": "git diff HEAD -- README",
291 "export GIT_AUTHOR_NAME='A U Thor'",
292 "export GIT_AUTHOR_EMAIL=author@example.com",
293 "export GIT_COMMITTER_NAME='C O Mitter'",
294 "export GIT_COMMITTER_EMAIL=committer@example.com",
295 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
296 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
298 "echo 'This project is wonderful' > README",
299 "echo 'Lots of widgets' > widgets",
300 "git add README widgets",
301 "git commit -m 'Add some widgets'",
302 "echo 'Take a look in the widgets file.' >> README",
303 "echo 'Widget-1 should be blue' >> widgets",
306 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-diff.html",
312 "class": "ScriptQuestion",
314 "id": "git diff --cached",
316 "You've edited a few files since the last commit, and staged some of them.",
317 "Ask Git to display only the changes you've staged."
319 "answer": "git diff --cached",
321 "export GIT_AUTHOR_NAME='A U Thor'",
322 "export GIT_AUTHOR_EMAIL=author@example.com",
323 "export GIT_COMMITTER_NAME='C O Mitter'",
324 "export GIT_COMMITTER_EMAIL=committer@example.com",
325 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
326 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
328 "echo 'This project is wonderful' > README",
329 "echo 'Lots of widgets' > widgets",
330 "git add README widgets",
331 "git commit -m 'Add some widgets'",
332 "echo 'Take a look in the widgets file.' >> README",
333 "echo 'Widget-1 should be blue' >> widgets",
336 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-diff.html",
342 "class": "ScriptQuestion",
345 "prompt": "Print the commits leading up to your current state.",
348 "export GIT_AUTHOR_NAME='A U Thor'",
349 "export GIT_AUTHOR_EMAIL=author@example.com",
350 "export GIT_COMMITTER_NAME='C O Mitter'",
351 "export GIT_COMMITTER_EMAIL=committer@example.com",
352 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
353 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
355 "echo 'This project is wonderful' > README",
356 "echo 'Lots of widgets' > widgets",
357 "git add README widgets",
358 "git commit -m 'Add some widgets'",
359 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
360 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
361 "echo 'Take a look in the widgets file.' >> README",
362 "echo 'Widget-1 should be blue' >> widgets",
363 "git commit -am 'More widgets'"
365 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
371 "class": "ScriptQuestion",
375 "Print the commits leading up to your current state,",
376 "showing a patch for each commit."
378 "answer": "git log -p",
380 "export GIT_AUTHOR_NAME='A U Thor'",
381 "export GIT_AUTHOR_EMAIL=author@example.com",
382 "export GIT_COMMITTER_NAME='C O Mitter'",
383 "export GIT_COMMITTER_EMAIL=committer@example.com",
384 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
385 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
387 "echo 'This project is wonderful' > README",
388 "echo 'Lots of widgets' > widgets",
389 "git add README widgets",
390 "git commit -m 'Add some widgets'",
391 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
392 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
393 "echo 'Take a look in the widgets file.' >> README",
394 "echo 'Widget-1 should be blue' >> widgets",
395 "git commit -am 'More widgets'"
397 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
403 "class": "ScriptQuestion",
405 "id": "git log --stat",
407 "Print the commits leading up to your current state,",
408 "showing the files changed by each commit."
410 "answer": "git log --stat",
412 "export GIT_AUTHOR_NAME='A U Thor'",
413 "export GIT_AUTHOR_EMAIL=author@example.com",
414 "export GIT_COMMITTER_NAME='C O Mitter'",
415 "export GIT_COMMITTER_EMAIL=committer@example.com",
416 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
417 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
419 "echo 'This project is wonderful' > README",
420 "echo 'Lots of widgets' > widgets",
421 "git add README widgets",
422 "git commit -m 'Add some widgets'",
423 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
424 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
425 "echo 'Take a look in the widgets file.' >> README",
426 "echo 'Widget-1 should be blue' >> widgets",
427 "git commit -am 'More widgets'"
429 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
435 "class": "ScriptQuestion",
437 "id": "git log --all",
439 "Print every commit in your repository reachable from a reference",
440 "(e.g from any tag or branch)"
442 "answer": "git log --all",
444 "export GIT_AUTHOR_NAME='A U Thor'",
445 "export GIT_AUTHOR_EMAIL=author@example.com",
446 "export GIT_COMMITTER_NAME='C O Mitter'",
447 "export GIT_COMMITTER_EMAIL=committer@example.com",
448 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
449 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
451 "echo 'This project is wonderful' > README",
452 "echo 'Lots of widgets' > widgets",
453 "git add README widgets",
454 "git commit -m 'Add some widgets'",
455 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
456 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
457 "git checkout -b more-widgets",
458 "echo 'Take a look in the widgets file.' >> README",
459 "echo 'Widget-1 should be blue' >> widgets",
460 "git commit -am 'More widgets'",
461 "git checkout master"
463 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
470 "class": "ScriptQuestion",
472 "id": "git log --oneline",
474 "Print the commits leading up to your current state,",
475 "with each commit only using a single line."
477 "answer": "git log --oneline",
479 "export GIT_AUTHOR_NAME='A U Thor'",
480 "export GIT_AUTHOR_EMAIL=author@example.com",
481 "export GIT_COMMITTER_NAME='C O Mitter'",
482 "export GIT_COMMITTER_EMAIL=committer@example.com",
483 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
484 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
486 "echo 'This project is wonderful' > README",
487 "echo 'Lots of widgets' > widgets",
488 "git add README widgets",
489 "git commit -m 'Add some widgets'",
490 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
491 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
492 "echo 'Take a look in the widgets file.' >> README",
493 "echo 'Widget-1 should be blue' >> widgets",
494 "git commit -am 'More widgets'"
496 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
502 "class": "ScriptQuestion",
504 "id": "git log --oneline --graph",
506 "Print the commits leading up to your current state,",
507 "with each commit only using a single line",
508 "and an ASCII-art inheritence graph."
510 "answer": "git log --oneline --graph",
512 "export GIT_AUTHOR_NAME='A U Thor'",
513 "export GIT_AUTHOR_EMAIL=author@example.com",
514 "export GIT_COMMITTER_NAME='C O Mitter'",
515 "export GIT_COMMITTER_EMAIL=committer@example.com",
516 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
517 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
519 "echo 'This project is wonderful' > README",
520 "echo 'Lots of widgets' > widgets",
521 "git add README widgets",
522 "git commit -m 'Add some widgets'",
523 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
524 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
525 "echo 'Take a look in the widgets file.' >> README",
526 "echo 'Widget-1 should be blue' >> widgets",
527 "git commit -am 'More widgets'"
529 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
535 "class": "ScriptQuestion",
537 "id": "git log --oneline --decorate",
539 "Print the commits leading up to your current state,",
540 "with each commit only using a single line",
541 "and reference (e.g. tag and branch) names before the summary"
543 "answer": "git log --oneline --decorate",
545 "export GIT_AUTHOR_NAME='A U Thor'",
546 "export GIT_AUTHOR_EMAIL=author@example.com",
547 "export GIT_COMMITTER_NAME='C O Mitter'",
548 "export GIT_COMMITTER_EMAIL=committer@example.com",
549 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
550 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
552 "echo 'This project is wonderful' > README",
553 "echo 'Lots of widgets' > widgets",
554 "git add README widgets",
555 "git commit -m 'Add some widgets'",
556 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
557 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
558 "echo 'Take a look in the widgets file.' >> README",
559 "echo 'Widget-1 should be blue' >> widgets",
560 "git commit -am 'More widgets'"
562 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-log.html",
569 "class": "ScriptQuestion",
571 "id": "git checkout HEAD -- FILE",
573 "You've messed up your README file.",
574 "Restore it to the last committed version."
576 "answer": "git checkout HEAD -- README",
578 "export GIT_AUTHOR_NAME='A U Thor'",
579 "export GIT_AUTHOR_EMAIL=author@example.com",
580 "export GIT_COMMITTER_NAME='C O Mitter'",
581 "export GIT_COMMITTER_EMAIL=committer@example.com",
582 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
583 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
585 "echo 'This project is wonderful' > README",
587 "git commit -am 'Add a README'",
588 "echo 'This project is terrible' > README"
594 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
600 "class": "ScriptQuestion",
602 "id": "git commit --amend",
604 "You messed up your README file in your last commit.",
605 "You just fixed the contents of `README`, but haven't added it to the index.",
606 "Commit the new version so it also fixes the last commit.",
607 "The fixed commit message should be `Add a README`."
612 "git commit --amend -am 'Add a README'"
615 "export GIT_AUTHOR_NAME='A U Thor'",
616 "export GIT_AUTHOR_EMAIL=author@example.com",
617 "export GIT_COMMITTER_NAME='C O Mitter'",
618 "export GIT_COMMITTER_EMAIL=committer@example.com",
619 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
620 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
622 "echo 'This project is terrible' > README",
624 "git commit -am 'Add a README'",
625 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
626 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
627 "echo 'This project is wonderful' > README"
633 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
640 "class": "ScriptQuestion",
643 "prompt": "Tell git to ignore files ending with `~`.",
645 "answer": "echo '*~' > .gitignore",
651 "git status | grep some-file"
653 "help": "http://www.kernel.org/pub/software/scm/git/docs/gitignore.html",
659 "class": "ScriptQuestion",
662 "prompt": "List all the local branches in your repository.",
663 "answer": "git branch",
665 "export GIT_AUTHOR_NAME='A U Thor'",
666 "export GIT_AUTHOR_EMAIL=author@example.com",
667 "export GIT_COMMITTER_NAME='C O Mitter'",
668 "export GIT_COMMITTER_EMAIL=committer@example.com",
669 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
670 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
674 " git commit --allow-empty -m 'Dummy commit'",
675 " git branch feature-x",
676 " git branch feature-y",
678 "git clone origin test",
680 "git branch feature-z"
682 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-branch.html",
688 "class": "ScriptQuestion",
690 "id": "git branch -a",
691 "prompt": "List all the branches (local and remote-tracking) in your repository.",
692 "answer": "git branch -a",
694 "export GIT_AUTHOR_NAME='A U Thor'",
695 "export GIT_AUTHOR_EMAIL=author@example.com",
696 "export GIT_COMMITTER_NAME='C O Mitter'",
697 "export GIT_COMMITTER_EMAIL=committer@example.com",
698 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
699 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
703 " git commit --allow-empty -m 'Dummy commit'",
704 " git branch feature-x",
705 " git branch feature-y",
707 "git clone origin test",
709 "git branch feature-z"
711 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-branch.html",
717 "class": "ScriptQuestion",
719 "id": "git branch -r",
720 "prompt": "List the remote-tracking branches in your repository.",
721 "answer": "git branch -r",
723 "export GIT_AUTHOR_NAME='A U Thor'",
724 "export GIT_AUTHOR_EMAIL=author@example.com",
725 "export GIT_COMMITTER_NAME='C O Mitter'",
726 "export GIT_COMMITTER_EMAIL=committer@example.com",
727 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
728 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
732 " git commit --allow-empty -m 'Dummy commit'",
733 " git branch feature-x",
734 " git branch feature-y",
736 "git clone origin test",
738 "git branch feature-z"
740 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-branch.html",
746 "class": "ScriptQuestion",
748 "id": "git branch -d",
749 "prompt": "Delete the local `widget-x` branch",
750 "answer": "git branch -d widget-x",
752 "export GIT_AUTHOR_NAME='A U Thor'",
753 "export GIT_AUTHOR_EMAIL=author@example.com",
754 "export GIT_COMMITTER_NAME='C O Mitter'",
755 "export GIT_COMMITTER_EMAIL=committer@example.com",
756 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
757 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
759 "git commit --allow-empty -m 'Dummy commit'",
760 "git branch widget-x"
762 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-branch.html",
768 "class": "ScriptQuestion",
770 "id": "git checkout",
771 "prompt": "Change your working directory to the `widget-x` branch",
772 "answer": "git checkout widget-x",
774 "export GIT_AUTHOR_NAME='A U Thor'",
775 "export GIT_AUTHOR_EMAIL=author@example.com",
776 "export GIT_COMMITTER_NAME='C O Mitter'",
777 "export GIT_COMMITTER_EMAIL=committer@example.com",
778 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
779 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
781 "git commit --allow-empty -m 'Dummy commit'",
782 "git branch widget-x"
787 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
793 "class": "ScriptQuestion",
795 "id": "git checkout -b",
796 "prompt": "Create and change to a new `widget-x` branch",
797 "answer": "git checkout -b widget-x",
799 "export GIT_AUTHOR_NAME='A U Thor'",
800 "export GIT_AUTHOR_EMAIL=author@example.com",
801 "export GIT_COMMITTER_NAME='C O Mitter'",
802 "export GIT_COMMITTER_EMAIL=committer@example.com",
803 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
804 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
806 "git commit --allow-empty -m 'Dummy commit'"
810 "git log --all --oneline --graph --decorate"
812 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
818 "class": "ScriptQuestion",
820 "id": "git checkout -b NEW_BRANCH START_POINT",
821 "prompt": "Create and change to a new `widget-y` branch based on the `widget-x` branch.",
822 "answer": "git checkout -b widget-y widget-x",
824 "export GIT_AUTHOR_NAME='A U Thor'",
825 "export GIT_AUTHOR_EMAIL=author@example.com",
826 "export GIT_COMMITTER_NAME='C O Mitter'",
827 "export GIT_COMMITTER_EMAIL=committer@example.com",
828 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
829 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
831 "git commit --allow-empty -m 'Dummy commit'",
832 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
833 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
834 "git checkout -b widget-x",
835 "echo 'Widget X will be wonderful' > README",
837 "git commit -am 'Add widget-x documentation'",
838 "git checkout master"
842 "git log --all --oneline --graph --decorate"
844 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
850 "class": "ScriptQuestion",
853 "prompt": "Merge the `widget-x` branch into the current branch",
854 "answer": "git merge widget-x",
856 "export GIT_AUTHOR_NAME='A U Thor'",
857 "export GIT_AUTHOR_EMAIL=author@example.com",
858 "export GIT_COMMITTER_NAME='C O Mitter'",
859 "export GIT_COMMITTER_EMAIL=committer@example.com",
860 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
861 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
863 "git commit --allow-empty -m 'Dummy commit'",
864 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
865 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
866 "git checkout -b widget-x",
867 "echo 'Widget X will be wonderful' > README",
869 "git commit -am 'Add widget-x documentation'",
870 "export GIT_AUTHOR_DATE=1970-01-01T00:02:00Z",
871 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
872 "git checkout master"
875 "git log --all --oneline --graph --decorate"
877 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-merge.html",
884 "class": "ScriptQuestion",
886 "id": "git remote add",
888 "Add a remote repository at `git://example.com/widgets.git`.",
889 "Call the new repository `widgets`."
891 "answer": "git remote add widgets git://example.com/widgets.git",
898 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-remote.html",
904 "class": "ScriptQuestion",
906 "id": "git remote -v",
907 "prompt": "List your configured remotes and their associated URLs.",
908 "answer": "git remote -v",
911 "git remote add alice git://alice.au/widgets.git",
912 "git remote add bob https://bob.br/bobs-widgets.git",
913 "git remote add charlie charlie@charlie.ca:wgts/"
915 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-remote.html",
922 "class": "ScriptQuestion",
924 "id": "git fetch REPOSITORY",
926 "Update remote-tracking branches following the `widgets` remote.",
927 "Don't merge any changes into your current branch."
929 "answer": "git fetch widgets",
931 "export GIT_AUTHOR_NAME='A U Thor'",
932 "export GIT_AUTHOR_EMAIL=author@example.com",
933 "export GIT_COMMITTER_NAME='C O Mitter'",
934 "export GIT_COMMITTER_EMAIL=committer@example.com",
935 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
936 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
940 " git commit --allow-empty -m 'Dummy commit'",
945 "git remote add widgets ../origin"
950 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html",
957 "class": "ScriptQuestion",
959 "id": "git push REPOSITORY BRANCH",
961 "Update the `master` branch on the `widgets` remote with",
962 "the current contents of your `master` branch."
964 "answer": "git push widgets master",
966 "export GIT_AUTHOR_NAME='A U Thor'",
967 "export GIT_AUTHOR_EMAIL=author@example.com",
968 "export GIT_COMMITTER_NAME='C O Mitter'",
969 "export GIT_COMMITTER_EMAIL=committer@example.com",
970 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
971 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
975 " git commit --allow-empty -m 'Dummy commit'",
977 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
978 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
979 "git clone --bare test origin",
980 "cd test # subshell closed in teardown",
981 "git remote add widgets ../origin",
982 "echo 'Widget X will be wonderful' > README",
984 "git commit -am 'Add widget-x documentation'"
990 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-push.html",