Skip to content

Commit 3275991

Browse files
committed
update all shell output to console lexer
1 parent 35edeff commit 3275991

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+717
-716
lines changed

atlas.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"version": "web",
2626
"index": true,
2727
"toc": true,
28-
"syntaxhighlighting": false,
28+
"syntaxhighlighting": true,
2929
"show_comments": false
3030
},
3131
"epub": {
@@ -62,7 +62,8 @@
6262
"toc": true,
6363
"syntaxhighlighting": false,
6464
"show_comments": false,
65-
"consolidate": false
65+
"consolidate": false,
66+
"consolidated": false
6667
}
6768
},
6869
"theme": "oreillymedia/atlas_tech1c_theme",

book/02-git-basics/sections/aliases.asc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Git doesn't automatically infer your command if you type it in partially.
99
If you don't want to type the entire text of each of the Git commands, you can easily set up an alias for each command using `git config`.(((git commands, config)))
1010
Here are a couple of examples you may want to set up:
1111

12-
[source,shell]
12+
[source,console]
1313
----
1414
$ git config --global alias.co checkout
1515
$ git config --global alias.br branch
@@ -23,14 +23,14 @@ As you go on using Git, you'll probably use other commands frequently as well; d
2323
This technique can also be very useful in creating commands that you think should exist.
2424
For example, to correct the usability problem you encountered with unstaging a file, you can add your own unstage alias to Git:
2525

26-
[source,shell]
26+
[source,console]
2727
----
2828
$ git config --global alias.unstage 'reset HEAD --'
2929
----
3030

3131
This makes the following two commands equivalent:
3232

33-
[source,shell]
33+
[source,console]
3434
----
3535
$ git unstage fileA
3636
$ git reset HEAD fileA
@@ -39,14 +39,14 @@ $ git reset HEAD fileA
3939
This seems a bit clearer.
4040
It's also common to add a `last` command, like this:
4141

42-
[source,shell]
42+
[source,console]
4343
----
4444
$ git config --global alias.last 'log -1 HEAD'
4545
----
4646

4747
This way, you can see the last commit easily:
4848

49-
[source,shell]
49+
[source,console]
5050
----
5151
$ git last
5252
commit 66938dae3329c7aebe598c2246a8e6af90d04646
@@ -64,7 +64,7 @@ In that case, you start the command with a `!` character.
6464
This is useful if you write your own tools that work with a Git repository.
6565
We can demonstrate by aliasing `git visual` to run `gitk`:
6666

67-
[source,shell]
67+
[source,console]
6868
----
6969
$ git config --global alias.visual "!gitk"
7070
----

book/02-git-basics/sections/getting-a-repository.asc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The second clones an existing Git repository from another server.
99

1010
If you're starting to track an existing project in Git, you need to go to the project's directory and type
1111

12-
[source,shell]
12+
[source,console]
1313
----
1414
$ git init
1515
----
@@ -21,7 +21,7 @@ At this point, nothing in your project is tracked yet.
2121
If you want to start version-controlling existing files (as opposed to an empty directory), you should probably begin tracking those files and do an initial commit.
2222
You can accomplish that with a few `git add` commands that specify the files you want to track, followed by a `git commit`:
2323

24-
[source,shell]
24+
[source,console]
2525
----
2626
$ git add *.c
2727
$ git add LICENSE
@@ -43,7 +43,7 @@ In fact, if your server disk gets corrupted, you can often use nearly any of the
4343
You clone a repository with `git clone [url]`.(((git commands, clone)))
4444
For example, if you want to clone the Git linkable library called libgit2, you can do so like this:
4545

46-
[source,shell]
46+
[source,console]
4747
----
4848
$ git clone https://github.com/libgit2/libgit2
4949
----
@@ -52,7 +52,7 @@ That creates a directory named ``libgit2'', initializes a `.git` directory insid
5252
If you go into the new `libgit2` directory, you'll see the project files in there, ready to be worked on or used.
5353
If you want to clone the repository into a directory named something other than ``libgit2'', you can specify that as the next command-line option:
5454

55-
[source,shell]
55+
[source,console]
5656
----
5757
$ git clone https://github.com/libgit2/libgit2 mylibgit
5858
----

book/02-git-basics/sections/recording-changes.asc

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ image::images/lifecycle.png[The lifecycle of the status of your files.]
2020
The main tool you use to determine which files are in which state is the `git status` command.(((git commands, status)))
2121
If you run this command directly after a clone, you should see something like this:
2222

23-
[source,shell]
23+
[source,console]
2424
----
2525
$ git status
2626
On branch master
@@ -36,7 +36,7 @@ For now, that branch is always ``master'', which is the default; you won't worry
3636
Let's say you add a new file to your project, a simple README file.
3737
If the file didn't exist before, and you run `git status`, you see your untracked file like so:
3838

39-
[source,shell]
39+
[source,console]
4040
----
4141
$ echo 'My Project' > README
4242
$ git status
@@ -60,14 +60,14 @@ You do want to start including README, so let's start tracking the file.
6060
In order to begin tracking a new file, you use the command `git add`.(((git commands, add)))
6161
To begin tracking the README file, you can run this:
6262

63-
[source,shell]
63+
[source,console]
6464
----
6565
$ git add README
6666
----
6767

6868
If you run your status command again, you can see that your README file is now tracked and staged to be committed:
6969

70-
[source,shell]
70+
[source,console]
7171
----
7272
$ git status
7373
On branch master
@@ -88,7 +88,7 @@ The `git add` command takes a path name for either a file or a directory; if it'
8888
Let's change a file that was already tracked.
8989
If you change a previously tracked file called ``benchmarks.rb'' and then run your `git status` command again, you get something that looks like this:
9090

91-
[source,shell]
91+
[source,console]
9292
----
9393
$ git status
9494
On branch master
@@ -109,7 +109,7 @@ The ``benchmarks.rb'' file appears under a section named ``Changed but not stage
109109
To stage it, you run the `git add` command. `git add` is a multipurpose command – you use it to begin tracking new files, to stage files, and to do other things like marking merge-conflicted files as resolved. It may be helpful to think of it more as ``add this content to the next commit'' rather than ``add this file to the project''.(((git commands, add)))
110110
Let's run `git add` now to stage the ``benchmarks.rb'' file, and then run `git status` again:
111111

112-
[source,shell]
112+
[source,console]
113113
----
114114
$ git add benchmarks.rb
115115
$ git status
@@ -127,7 +127,7 @@ At this point, suppose you remember one little change that you want to make in `
127127
You open it again and make that change, and you're ready to commit.
128128
However, let's run `git status` one more time:
129129

130-
[source,shell]
130+
[source,console]
131131
----
132132
$ vim benchmarks.rb
133133
$ git status
@@ -153,7 +153,7 @@ It turns out that Git stages a file exactly as it is when you run the `git add`
153153
If you commit now, the version of `benchmarks.rb` as it was when you last ran the `git add` command is how it will go into the commit, not the version of the file as it looks in your working directory when you run `git commit`.
154154
If you modify a file after you run `git add`, you have to run `git add` again to stage the latest version of the file:
155155

156-
[source,shell]
156+
[source,console]
157157
----
158158
$ git add benchmarks.rb
159159
$ git status
@@ -169,7 +169,7 @@ Changes to be committed:
169169

170170
While the `git status` output is pretty comprehensive, it's also quite wordy. Git also has a short status flag so you can see your changes in a more compact way. If you run `git status -s` or `git status --short` you get a far more simplified output from the command.
171171

172-
[source,shell]
172+
[source,console]
173173
----
174174
$ git status -s
175175
M README
@@ -189,7 +189,7 @@ These are generally automatically generated files such as log files or files pro
189189
In such cases, you can create a file listing patterns to match them named `.gitignore`.(((ignoring files)))
190190
Here is an example `.gitignore` file:
191191

192-
[source,shell]
192+
[source,console]
193193
----
194194
$ cat .gitignore
195195
*.[oa]
@@ -214,7 +214,7 @@ You can also use two asterisks to match nested directories; `a/**/z` would match
214214

215215
Here is another example .gitignore file:
216216

217-
[source,shell]
217+
[source,console]
218218
----
219219
# a comment - this is ignored
220220
*.a # no .a files
@@ -240,7 +240,7 @@ Although `git status` answers those questions very generally by listing the file
240240
Let's say you edit and stage the `README` file again and then edit the `benchmarks.rb` file without staging it.
241241
If you run your `git status` command, you once again see something like this:
242242

243-
[source,shell]
243+
[source,console]
244244
----
245245
$ git status
246246
On branch master
@@ -258,7 +258,7 @@ Changes not staged for commit:
258258

259259
To see what you've changed but not yet staged, type `git diff` with no other arguments:
260260

261-
[source,shell]
261+
[source,console]
262262
----
263263
$ git diff
264264
diff --git a/benchmarks.rb b/benchmarks.rb
@@ -284,7 +284,7 @@ The result tells you the changes you've made that you haven't yet staged.
284284
If you want to see what you've staged that will go into your next commit, you can use `git diff --staged`.
285285
This command compares your staged changes to your last commit:
286286

287-
[source,shell]
287+
[source,console]
288288
----
289289
$ git diff --staged
290290
diff --git a/README b/README
@@ -304,7 +304,7 @@ This can be confusing, because if you've staged all of your changes, `git diff`
304304

305305
For another example, if you stage the `benchmarks.rb` file and then edit it, you can use `git diff` to see the changes in the file that are staged and the changes that are unstaged:
306306

307-
[source,shell]
307+
[source,console]
308308
----
309309
$ git add benchmarks.rb
310310
$ echo '# test line' >> benchmarks.rb
@@ -324,7 +324,7 @@ Changes not staged for commit:
324324

325325
Now you can use `git diff` to see what is still unstaged
326326

327-
[source,shell]
327+
[source,console]
328328
----
329329
$ git diff
330330
diff --git a/benchmarks.rb b/benchmarks.rb
@@ -340,7 +340,7 @@ index e445e28..86b2f7c 100644
340340

341341
and `git diff --cached` to see what you've staged so far:
342342

343-
[source,shell]
343+
[source,console]
344344
----
345345
$ git diff --cached
346346
diff --git a/benchmarks.rb b/benchmarks.rb
@@ -369,7 +369,7 @@ They will stay as modified files on your disk.
369369
In this case, let's say that the last time you ran `git status`, you saw that everything was staged, so you're ready to commit your changes.(((git commands, status)))
370370
The simplest way to commit is to type `git commit`:(((git commands, commit)))
371371

372-
[source,shell]
372+
[source,console]
373373
----
374374
$ git commit
375375
----
@@ -379,7 +379,7 @@ Doing so launches your editor of choice.
379379

380380
The editor displays the following text (this example is a Vim screen):
381381

382-
[source,shell]
382+
[source,console]
383383
----
384384
385385
# Please enter the commit message for your changes. Lines starting
@@ -403,7 +403,7 @@ When you exit the editor, Git creates your commit with that commit message (with
403403

404404
Alternatively, you can type your commit message inline with the `commit` command by specifying it after a -m flag, like this:
405405

406-
[source,shell]
406+
[source,console]
407407
----
408408
$ git commit -m "Story 182: Fix benchmarks for speed"
409409
[master 463dc4f] Story 182: Fix benchmarks for speed
@@ -425,7 +425,7 @@ Although it can be amazingly useful for crafting commits exactly how you want th
425425
If you want to skip the staging area, Git provides a simple shortcut.
426426
Adding the `-a` option to the `git commit` command makes Git automatically stage every file that is already tracked before doing the commit, letting you skip the `git add` part:
427427

428-
[source,shell]
428+
[source,console]
429429
----
430430
$ git status
431431
On branch master
@@ -452,7 +452,7 @@ The `git rm` command does that, and also removes the file from your working dire
452452

453453
If you simply remove the file from your working directory, it shows up under the ``Changed but not updated'' (that is, _unstaged_) area of your `git status` output:
454454

455-
[source,shell]
455+
[source,console]
456456
----
457457
$ rm grit.gemspec
458458
$ git status
@@ -468,7 +468,7 @@ no changes added to commit (use "git add" and/or "git commit -a")
468468

469469
Then, if you run `git rm`, it stages the file's removal:
470470

471-
[source,shell]
471+
[source,console]
472472
----
473473
$ git rm grit.gemspec
474474
rm 'grit.gemspec'
@@ -489,15 +489,15 @@ In other words, you may want to keep the file on your hard drive but not have Gi
489489
This is particularly useful if you forgot to add something to your `.gitignore` file and accidentally added it, like a large log file or a bunch of `.a` compiled files.
490490
To do this, use the `--cached` option:
491491

492-
[source,shell]
492+
[source,console]
493493
----
494494
$ git rm --cached README
495495
----
496496

497497
You can pass files, directories, and file-glob patterns to the `git rm` command.
498498
That means you can do things such as
499499

500-
[source,shell]
500+
[source,console]
501501
----
502502
$ git rm log/\*.log
503503
----
@@ -507,7 +507,7 @@ This is necessary because Git does its own filename expansion in addition to you
507507
This command removes all files that have the `.log` extension in the `log/` directory.
508508
Or, you can do something like this:
509509

510-
[source,shell]
510+
[source,console]
511511
----
512512
$ git rm \*~
513513
----
@@ -525,15 +525,15 @@ However, Git is pretty smart about figuring that out after the fact – we'll de
525525
Thus it's a bit confusing that Git has a `mv` command.
526526
If you want to rename a file in Git, you can run something like
527527

528-
[source,shell]
528+
[source,console]
529529
----
530530
$ git mv file_from file_to
531531
----
532532

533533
and it works fine.
534534
In fact, if you run something like this and look at the status, you'll see that Git considers it a renamed file:
535535

536-
[source,shell]
536+
[source,console]
537537
----
538538
$ git mv README.md README
539539
$ git status
@@ -546,7 +546,7 @@ Changes to be committed:
546546

547547
However, this is equivalent to running something like this:
548548

549-
[source,shell]
549+
[source,console]
550550
----
551551
$ mv README.md README
552552
$ git rm README.md

0 commit comments

Comments
 (0)