3a6d3d5fad8cbf72dbdd5014a1b7d0226c88a88b
[quizzer.git] / quizzes / git.json
1 {
2         "version": "0.1",
3         "questions": [
4                 {
5                         "class": "ScriptQuestion",
6                         "intepreter": "sh",
7                         "id": "git help config",
8                         "prompt": "Get help for Git's `config` command",
9                         "answer": "git help config",
10                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-help.html",
11                         "tags": [
12                                 "help"
13                                 ]
14                 },
15                 {
16                         "class": "ScriptQuestion",
17                         "interpreter": "sh",
18                         "id": "git config --global user.name",
19                         "prompt": "Configure your user-wide name to be `A U Thor`.",
20                         "answer": "git config --global user.name 'A U Thor'",
21                         "setup": [
22                                         "export HOME=."
23                                         ],
24                         "teardown": [
25                                 "cat .gitconfig"
26                                 ],
27                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
28                         "tags": [
29                                 "config"
30                                 ]
31                 },
32                 {
33                         "class": "ScriptQuestion",
34                         "interpreter": "sh",
35                         "id": "git config --global user.email",
36                         "prompt": "Configure your user-wide email to be `author@example.com`.",
37                         "answer": "git config --global user.email 'author@example.com'",
38                         "setup": [
39                                         "export HOME=."
40                                         ],
41                         "teardown": [
42                                 "cat .gitconfig"
43                                 ],
44                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
45                         "tags": [
46                                 "config"
47                                 ]
48                 },
49                 {
50                         "class": "ScriptQuestion",
51                         "interpreter": "sh",
52                         "id": "git init",
53                         "prompt": "Initialize a Git repository in a new `my-project` directory.",
54                         "multiline": true,
55                         "answer": [
56                                         "mkdir my-project",
57                                         "cd my-project",
58                                         "git init"
59                                         ],
60                         "teardown": [
61                                 "git status"
62                                 ],
63                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-init.html",
64                         "tags": [
65                                 "init"
66                                 ]
67                 },
68                 {
69                         "class": "ScriptQuestion",
70                         "interpreter": "sh",
71                         "id": "git clone",
72                         "prompt": "Clone git://github.com/wking/quizzer.git into a new `quizzer` directory.",
73                         "answer": "git clone git://github.com/wking/quizzer.git",
74                         "teardown": [
75                                 "cd quizzer",
76                                 "git status"
77                                 ],
78                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html",
79                         "tags": [
80                                 "init"
81                                 ]
82                 },
83                 {
84                         "class": "ScriptQuestion",
85                         "interpreter": "sh",
86                         "id": "git add / commit",
87                         "prompt": [
88                                 "There is a new README file in your repository.",
89                                 "Make a new commit including this README.",
90                                 "The commit message should be `Add a README`."
91                                 ],
92                         "multiline": true,
93                         "timeout": null,
94                         "answer": [
95                                 "git add README",
96                                 "git commit -m \"Add a README\""
97                                 ],
98                         "setup": [
99                                 "export GIT_AUTHOR_NAME='A U Thor'",
100                                 "export GIT_AUTHOR_EMAIL=author@example.com",
101                                 "export GIT_COMMITTER_NAME='C O Mitter'",
102                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
103                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
104                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
105                                 "git init",
106                                 "echo 'This project is wonderful' > README"
107                                 ],
108                         "teardown": [
109                                 "git ls-files",
110                                 "git status"
111                                 ],
112                         "help": [
113                                 "http://www.kernel.org/pub/software/scm/git/docs/git-add.html",
114                                 "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html"
115                                 ],
116                         "tags": [
117                                 "add",
118                                 "commit"
119                                 ]
120                 },
121                 {
122                         "class": "ScriptQuestion",
123                         "interpreter": "sh",
124                         "id": "git checkout HEAD -- FILE",
125                         "prompt": [
126                                 "You've messed up your README file.",
127                                 "Restore it to the last committed version."
128                                 ],
129                         "answer": "git checkout HEAD -- README",
130                         "setup": [
131                                 "export GIT_AUTHOR_NAME='A U Thor'",
132                                 "export GIT_AUTHOR_EMAIL=author@example.com",
133                                 "export GIT_COMMITTER_NAME='C O Mitter'",
134                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
135                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
136                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
137                                 "git init",
138                                 "echo 'This project is wonderful' > README",
139                                 "git add README",
140                                 "git commit -am 'Add a README'",
141                                 "echo 'This project is terrible' > README"
142                                 ],
143                         "teardown": [
144                                 "git status",
145                                 "cat README"
146                                 ],
147                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
148                         "tags": [
149                                 "checkout"
150                                 ]
151                 },
152                 {
153                         "class": "ScriptQuestion",
154                         "interpreter": "sh",
155                         "id": "git commit --amend",
156                         "prompt": [
157                                 "You messed up your README file in your last commit.",
158                                 "You just fixed the contents of `README`, but haven't added it to the index.",
159                                 "Commit the new version so it also fixes the last commit.",
160                                 "The fixed commit message should be `Add a README`."
161                                 ],
162                         "multiline": true,
163                         "timeout": null,
164                         "answer": [
165                                 "git commit --amend -am 'Add a README'"
166                                 ],
167                         "setup": [
168                                 "export GIT_AUTHOR_NAME='A U Thor'",
169                                 "export GIT_AUTHOR_EMAIL=author@example.com",
170                                 "export GIT_COMMITTER_NAME='C O Mitter'",
171                                 "export GIT_COMMITTER_EMAIL=committer@example.com",
172                                 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
173                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
174                                 "git init",
175                                 "echo 'This project is terrible' > README",
176                                 "git add README",
177                                 "git commit -am 'Add a README'",
178                                 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
179                                 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
180                                 "echo 'This project is wonderful' > README"
181                                 ],
182                         "teardown": [
183                                 "git log -p",
184                                 "git status"
185                                 ],
186                         "help": "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
187                         "tags": [
188                                 "commit",
189                                 "rewrite"
190                                 ]
191                 }
192         ]
193 }