Skip to content

Commit 8bb2198

Browse files
authored
Merge pull request #871 from rpjday/recording
Replace escape sequence for "em" dash with asciidoc markup " -- "
2 parents 10be808 + cb0e5b5 commit 8bb2198

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Remember that each file in your working directory can be in one of two states: _
77
Tracked files are files that were in the last snapshot; they can be unmodified, modified, or staged.
88
In short, tracked files are files that Git knows about.
99

10-
Untracked files are everything else any files in your working directory that were not in your last snapshot and are not in your staging area.
10+
Untracked files are everything else -- any files in your working directory that were not in your last snapshot and are not in your staging area.
1111
When you first clone a repository, all of your files will be tracked and unmodified because Git just checked them out and you haven't edited anything.
1212

1313
As you edit files, Git sees them as modified, because you've changed them since your last commit.
@@ -30,7 +30,7 @@ Your branch is up-to-date with 'origin/master'.
3030
nothing to commit, working directory clean
3131
----
3232

33-
This means you have a clean working directory in other words, none of your tracked files are modified.
33+
This means you have a clean working directory -- in other words, none of your tracked files are modified.
3434
Git also doesn't see any untracked files, or they would be listed here.
3535
Finally, the command tells you which branch you're on and informs you that it has not diverged from the same branch on the server.
3636
For now, that branch is always ``master'', which is the default; you won't worry about it here.
@@ -85,7 +85,7 @@ Changes to be committed:
8585

8686
You can tell that it's staged because it's under the ``Changes to be committed'' heading.
8787
If you commit at this point, the version of the file at the time you ran `git add` is what will be in the historical snapshot.
88-
You may recall that when you ran `git init` earlier, you then ran `git add <files>` that was to begin tracking files in your directory.(((git commands, init)))(((git commands, add)))
88+
You may recall that when you ran `git init` earlier, you then ran `git add <files>` -- that was to begin tracking files in your directory.(((git commands, init)))(((git commands, add)))
8989
The `git add` command takes a path name for either a file or a directory; if it's a directory, the command adds all the files in that directory recursively.
9090

9191
==== Staging Modified Files
@@ -111,10 +111,10 @@ Changes not staged for commit:
111111
112112
----
113113

114-
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.
114+
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.
115115
To stage it, you run the `git add` command.
116-
`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.
117-
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)))
116+
`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.
117+
It may be helpful to think of it more as ``add precisely this content to the next commit'' rather than ``add this file to the project''.(((git commands, add)))
118118
Let's run `git add` now to stage the `CONTRIBUTING.md` file, and then run `git status` again:
119119

120120
[source,console]
@@ -212,7 +212,7 @@ $ cat .gitignore
212212
*~
213213
----
214214

215-
The first line tells Git to ignore any files ending in ``.o'' or ``.a'' object and archive files that may be the product of building your code.
215+
The first line tells Git to ignore any files ending in ``.o'' or ``.a'' -- object and archive files that may be the product of building your code.
216216
The second line tells Git to ignore all files whose names end with a tilde (`~`), which is used by many text editors such as Emacs to mark temporary files.
217217
You may also include a log, tmp, or pid directory; automatically generated documentation; and so on.
218218
Setting up a `.gitignore` file for your new repository before you get going is generally a good idea so you don't accidentally commit files that you really don't want in your Git repository.
@@ -270,10 +270,10 @@ It is beyond the scope of this book to get into the details of multiple `.gitign
270270
[[_git_diff_staged]]
271271
==== Viewing Your Staged and Unstaged Changes
272272

273-
If the `git status` command is too vague for you you want to know exactly what you changed, not just which files were changed you can use the `git diff` command.(((git commands, diff)))
273+
If the `git status` command is too vague for you -- you want to know exactly what you changed, not just which files were changed -- you can use the `git diff` command.(((git commands, diff)))
274274
We'll cover `git diff` in more detail later, but you'll probably use it most often to answer these two questions: What have you changed but not yet staged?
275275
And what have you staged that you are about to commit?
276-
Although `git status` answers those questions very generally by listing the file names, `git diff` shows you the exact lines added and removed the patch, as it were.
276+
Although `git status` answers those questions very generally by listing the file names, `git diff` shows you the exact lines added and removed -- the patch, as it were.
277277

278278
Let's say you edit and stage the `README` file again and then edit the `CONTRIBUTING.md` file without staging it.
279279
If you run your `git status` command, you once again see something like this:
@@ -334,7 +334,7 @@ index 0000000..03902a1
334334
+My Project
335335
----
336336

337-
It's important to note that `git diff` by itself doesn't show all changes made since your last commit only changes that are still unstaged.
337+
It's important to note that `git diff` by itself doesn't show all changes made since your last commit -- only changes that are still unstaged.
338338
This can be confusing, because if you've staged all of your changes, `git diff` will give you no output.
339339

340340
For another example, if you stage the `CONTRIBUTING.md` 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.
@@ -409,7 +409,7 @@ Run `git difftool --tool-help` to see what is available on your system.
409409
==== Committing Your Changes
410410

411411
Now that your staging area is set up the way you want it, you can commit your changes.
412-
Remember that anything that is still unstaged any files you have created or modified that you haven't run `git add` on since you edited them won't go into this commit.
412+
Remember that anything that is still unstaged -- any files you have created or modified that you haven't run `git add` on since you edited them -- won't go into this commit.
413413
They will stay as modified files on your disk.
414414
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)))
415415
The simplest way to commit is to type `git commit`:(((git commands, commit)))
@@ -420,7 +420,7 @@ $ git commit
420420
----
421421

422422
Doing so launches your editor of choice.
423-
(This is set by your shell's `EDITOR` environment variable usually vim or emacs, although you can configure it with whatever you want using the `git config --global core.editor` command as you saw in <<_getting_started>>).(((editor, changing default)))(((git commands, config)))
423+
(This is set by your shell's `EDITOR` environment variable -- usually vim or emacs, although you can configure it with whatever you want using the `git config --global core.editor` command as you saw in <<_getting_started>>).(((editor, changing default)))(((git commands, config)))
424424

425425
The editor displays the following text (this example is a Vim screen):
426426

@@ -572,7 +572,7 @@ This command removes all files whose names end with a `~`.
572572
(((files, moving)))
573573
Unlike many other VCS systems, Git doesn't explicitly track file movement.
574574
If you rename a file in Git, no metadata is stored in Git that tells it you renamed the file.
575-
However, Git is pretty smart about figuring that out after the fact we'll deal with detecting file movement a bit later.
575+
However, Git is pretty smart about figuring that out after the fact -- we'll deal with detecting file movement a bit later.
576576

577577
Thus it's a bit confusing that Git has a `mv` command.
578578
If you want to rename a file in Git, you can run something like:
@@ -607,5 +607,5 @@ $ git add README
607607
----
608608

609609
Git figures out that it's a rename implicitly, so it doesn't matter if you rename a file that way or with the `mv` command.
610-
The only real difference is that `git mv` is one command instead of three it's a convenience function.
610+
The only real difference is that `git mv` is one command instead of three -- it's a convenience function.
611611
More importantly, you can use any tool you like to rename a file, and address the add/rm later, before you commit.

0 commit comments

Comments
 (0)