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",
124 "id": "git checkout HEAD -- FILE",
126 "You've messed up your README file.",
127 "Restore it to the last committed version."
129 "answer": "git checkout HEAD -- README",
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\"",
138 "echo 'This project is wonderful' > README",
140 "git commit -am 'Add a README'",
141 "echo 'This project is terrible' > README"
147 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html",
153 "class": "ScriptQuestion",
155 "id": "git commit --amend",
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`."
165 "git commit --amend -am 'Add a README'"
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\"",
175 "echo 'This project is terrible' > 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"
186 "help": "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html",
193 "class": "ScriptQuestion",
196 "prompt": "Tell git to ignore files ending with `~`.",
197 "answer": "echo '*~' > .gitignore",
203 "git status | grep some-file"
205 "help": "http://www.kernel.org/pub/software/scm/git/docs/gitignore.html",