Skip to content

Commit 83bb412

Browse files
committed
Merge pull request #499 from crd/filename_consistency
Make examples that refer to files by name consistent
2 parents 1ba885d + 62b962f commit 83bb412

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The `git add` command takes a path name for either a file or a directory; if it'
8686
==== Staging Modified Files
8787

8888
Let's change a file that was already tracked.
89-
If you change a previously tracked file called ``CONTRIBUTING.md'' and then run your `git status` command again, you get something that looks like this:
89+
If you change a previously tracked file called `CONTRIBUTING.md` and then run your `git status` command again, you get something that looks like this:
9090

9191
[source,console]
9292
----
@@ -105,11 +105,11 @@ Changes not staged for commit:
105105
106106
----
107107

108-
The ``CONTRIBUTING.md'' file appears under a section named ``Changes not staged for commit'' – which means that a file that is tracked has been modified in the working directory but not yet staged.
108+
The `CONTRIBUTING.md` file appears under a section named ``Changes not staged for commit'' – which means that a file that is tracked has been modified in the working directory but not yet staged.
109109
To stage it, you run the `git add` command.
110110
`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.
111111
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)))
112-
Let's run `git add` now to stage the ``CONTRIBUTING.md'' file, and then run `git status` again:
112+
Let's run `git add` now to stage the `CONTRIBUTING.md` file, and then run `git status` again:
113113

114114
[source,console]
115115
----
@@ -465,7 +465,7 @@ $ git commit -a -m 'added new benchmarks'
465465
1 file changed, 5 insertions(+), 0 deletions(-)
466466
----
467467

468-
Notice how you don't have to run `git add` on the ``CONTRIBUTING.md'' file in this case before you commit.
468+
Notice how you don't have to run `git add` on the `CONTRIBUTING.md` file in this case before you commit.
469469

470470
[[_removing_files]]
471471
==== Removing Files

book/07-git-tools/sections/rewriting-history.asc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ This occurs fairly commonly.
273273
Someone accidentally commits a huge binary file with a thoughtless `git add .`, and you want to remove it everywhere.
274274
Perhaps you accidentally committed a file that contained a password, and you want to make your project open source.
275275
`filter-branch` is the tool you probably want to use to scrub your entire history.
276-
To remove a file named passwords.txt from your entire history, you can use the `--tree-filter` option to `filter-branch`:
276+
To remove a file named `passwords.txt` from your entire history, you can use the `--tree-filter` option to `filter-branch`:
277277

278278
[source,console]
279279
----
@@ -283,7 +283,7 @@ Ref 'refs/heads/master' was rewritten
283283
----
284284

285285
The `--tree-filter` option runs the specified command after each checkout of the project and then recommits the results.
286-
In this case, you remove a file called passwords.txt from every snapshot, whether it exists or not.
286+
In this case, you remove a file called `passwords.txt` from every snapshot, whether it exists or not.
287287
If you want to remove all accidentally committed editor backup files, you can run something like `git filter-branch --tree-filter 'rm -f *~' HEAD`.
288288

289289
You’ll be able to watch Git rewriting trees and commits and then move the branch pointer at the end.
@@ -292,7 +292,7 @@ To run `filter-branch` on all your branches, you can pass `--all` to the command
292292

293293
===== Making a Subdirectory the New Root
294294

295-
Suppose you’ve done an import from another source control system and have subdirectories that make no sense (trunk, tags, and so on).
295+
Suppose you’ve done an import from another source control system and have subdirectories that make no sense (`trunk`, `tags`, and so on).
296296
If you want to make the `trunk` subdirectory be the new project root for every commit, `filter-branch` can help you do that, too:
297297

298298
[source,console]

book/09-git-and-other-scms/sections/import-svn.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $ svn log --xml | grep author | sort -u | \
2828

2929
That generates the log output in XML format, then keeps only the lines with author information, discards duplicates, strips out the XML tags.
3030
(Obviously this only works on a machine with `grep`, `sort`, and `perl` installed.)
31-
Then, redirect that output into your users.txt file so you can add the equivalent Git user data next to each entry.
31+
Then, redirect that output into your `users.txt` file so you can add the equivalent Git user data next to each entry.
3232

3333
You can provide this file to `git svn` to help it map the author data more accurately.
3434
You can also tell `git svn` not to include the metadata that Subversion normally imports, by passing `--no-metadata` to the `clone` or `init` command.

book/10-git-internals/sections/objects.asc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ image::images/data-model-1.png[Simple version of the Git data model.]
149149
You can fairly easily create your own tree.
150150
Git normally creates a tree by taking the state of your staging area or index and writing a series of tree objects from it.
151151
So, to create a tree object, you first have to set up an index by staging some files.
152-
To create an index with a single entry – the first version of your test.txt file – you can use the plumbing command `update-index`.
153-
You use this command to artificially add the earlier version of the test.txt file to a new staging area.
152+
To create an index with a single entry – the first version of your `test.txt` file – you can use the plumbing command `update-index`.
153+
You use this command to artificially add the earlier version of the `test.txt` file to a new staging area.
154154
You must pass it the `--add` option because the file doesn't yet exist in your staging area (you don't even have a staging area set up yet) and `--cacheinfo` because the file you're adding isn't in your directory but is in your database.
155155
Then, you specify the mode, SHA-1, and filename:
156156

@@ -183,7 +183,7 @@ $ git cat-file -t d8329fc1cc938780ffdd9f94e0d364e0ea74f579
183183
tree
184184
----
185185

186-
You'll now create a new tree with the second version of test.txt and a new file as well:
186+
You'll now create a new tree with the second version of `test.txt` and a new file as well:
187187

188188
[source,console]
189189
----
@@ -192,7 +192,7 @@ $ git update-index test.txt
192192
$ git update-index --add new.txt
193193
----
194194

195-
Your staging area now has the new version of test.txt as well as the new file new.txt.
195+
Your staging area now has the new version of `test.txt` as well as the new file `new.txt`.
196196
Write out that tree (recording the state of the staging area or index to a tree object) and see what it looks like:
197197

198198
[source,console]
@@ -204,7 +204,7 @@ $ git cat-file -p 0155eb4229851634a0f03eb265b69f5a2d56f341
204204
100644 blob 1f7a7a472abf3dd9643fd615f6da379c4acb3e3a test.txt
205205
----
206206

207-
Notice that this tree has both file entries and also that the test.txt SHA-1 is the ``version 2'' SHA-1 from earlier (`1f7a7a`).
207+
Notice that this tree has both file entries and also that the `test.txt` SHA-1 is the ``version 2'' SHA-1 from earlier (`1f7a7a`).
208208
Just for fun, you'll add the first tree as a subdirectory into this one.
209209
You can read trees into your staging area by calling `read-tree`.
210210
In this case, you can read an existing tree into your staging area as a subtree by using the `--prefix` option to `read-tree`:
@@ -220,7 +220,7 @@ $ git cat-file -p 3c4e9cd789d88d8d89c1073707c3585e41b0e614
220220
100644 blob 1f7a7a472abf3dd9643fd615f6da379c4acb3e3a test.txt
221221
----
222222

223-
If you created a working directory from the new tree you just wrote, you would get the two files in the top level of the working directory and a subdirectory named `bak` that contained the first version of the test.txt file.
223+
If you created a working directory from the new tree you just wrote, you would get the two files in the top level of the working directory and a subdirectory named `bak` that contained the first version of the `test.txt` file.
224224
You can think of the data that Git contains for these structures as being like this:
225225

226226
.The content structure of your current Git data.

0 commit comments

Comments
 (0)