5 "class": "ScriptQuestion",
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",
16 "class": "ScriptQuestion",
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'",
27 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
33 "class": "ScriptQuestion",
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'",
44 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-config.html",
50 "class": "ScriptQuestion",
53 "prompt": "Initialize a Git repository in a new `my-project` directory.",
63 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-init.html",
69 "class": "ScriptQuestion",
72 "prompt": "Clone git://github.com/wking/quizzer.git into a new `quizzer` directory.",
73 "answer": "git clone git://github.com/wking/quizzer.git",
78 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html",
84 "class": "ScriptQuestion",
86 "id": "git add / commit",
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`."
96 "git commit -m \"Add a README\""
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\"",
106 "echo 'This project is wonderful' > README"
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"
122 "class": "ScriptQuestion",
126 "You don't remember if you've staged README to be committed.",
127 "How would you check?"
129 "answer": "git status",
132 "echo 'This project is wonderful' > README",
135 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-status.html",
142 "class": "ScriptQuestion",
144 "id": "git checkout HEAD -- FILE",
146 "You've messed up your README file.",
147 "Restore it to the last committed version."
149 "answer": "git checkout HEAD -- README",
151 "export GIT_AUTHOR_NAME='A U Thor'",
152 "export GIT_AUTHOR_EMAIL=author@example.com",
153 "export GIT_COMMITTER_NAME='C O Mitter'",
154 "export GIT_COMMITTER_EMAIL=committer@example.com",
155 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
156 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
158 "echo 'This project is wonderful' > README",
160 "git commit -am 'Add a README'",
161 "echo 'This project is terrible' > README"
167 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
173 "class": "ScriptQuestion",
175 "id": "git commit --amend",
177 "You messed up your README file in your last commit.",
178 "You just fixed the contents of `README`, but haven't added it to the index.",
179 "Commit the new version so it also fixes the last commit.",
180 "The fixed commit message should be `Add a README`."
185 "git commit --amend -am 'Add a README'"
188 "export GIT_AUTHOR_NAME='A U Thor'",
189 "export GIT_AUTHOR_EMAIL=author@example.com",
190 "export GIT_COMMITTER_NAME='C O Mitter'",
191 "export GIT_COMMITTER_EMAIL=committer@example.com",
192 "export GIT_AUTHOR_DATE=1970-01-01T00:00:00Z",
193 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
195 "echo 'This project is terrible' > README",
197 "git commit -am 'Add a README'",
198 "export GIT_AUTHOR_DATE=1970-01-01T00:01:00Z",
199 "export GIT_COMMITTER_DATE=\"$GIT_AUTHOR_DATE\"",
200 "echo 'This project is wonderful' > README"
206 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
213 "class": "ScriptQuestion",
216 "prompt": "Tell git to ignore files ending with `~`.",
217 "answer": "echo '*~' > .gitignore",
223 "git status | grep some-file"
225 "help": "http://www.kernel.org/pub/software/scm/git/docs/gitignore.html",