Skip to content

Commit

Permalink
Merge pull request progit#329 from noisy/newline_should_separate_sent…
Browse files Browse the repository at this point in the history
…ences

New line should separate sentences (02-git-basics/sections/recording-changes.asc)
  • Loading branch information
ben committed Jul 14, 2015
2 parents 3426101 + ca0b586 commit 1d4253b
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions book/02-git-basics/sections/recording-changes.asc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ Changes not staged for commit:
----

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

[source,console]
Expand Down Expand Up @@ -167,7 +169,9 @@ Changes to be committed:

==== Short Status

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.
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.

[source,console]
----
Expand All @@ -179,7 +183,10 @@ M lib/simplegit.rb
?? LICENSE.txt
----

New files that aren't tracked have a `??` next to them, new files that have been added to the staging area have an `A`, modified files have an `M` and so on. There are two columns to the output - the left hand column indicates that the file is staged and the right hand column indicates that it's modified. So for example in that output, the `README` file is modified in the working directory but not yet staged, while the `lib/simplegit.rb` file is modified and staged. The `Rakefile` was modified, staged and then modified again, so there are changes to it that are both staged and unstaged.
New files that aren't tracked have a `??` next to them, new files that have been added to the staging area have an `A`, modified files have an `M` and so on.
There are two columns to the output - the left hand column indicates that the file is staged and the right hand column indicates that it's modified.
So for example in that output, the `README` file is modified in the working directory but not yet staged, while the `lib/simplegit.rb` file is modified and staged.
The `Rakefile` was modified, staged and then modified again, so there are changes to it that are both staged and unstaged.

[[_ignoring]]
==== Ignoring Files
Expand Down Expand Up @@ -310,7 +317,8 @@ index 0000000..03902a1
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.
This can be confusing, because if you've staged all of your changes, `git diff` will give you no output.

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. If our environment looks like this:
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.
If our environment looks like this:

[source,console]
----
Expand Down Expand Up @@ -370,7 +378,10 @@ index 8ebb991..643e24f 100644
[NOTE]
.Git Diff in an External Tool
====
We will continue to use the `git diff` command in various ways throughout the rest of the book. There is another way to look at these diffs if you prefer a graphical or external diff viewing program instead. If you run `git difftool` instead of `git diff`, you can view any of these diffs in software like Araxis, emerge, vimdiff and more. Run `git difftool --tool-help` to see what is available on your system.
We will continue to use the `git diff` command in various ways throughout the rest of the book.
There is another way to look at these diffs if you prefer a graphical or external diff viewing program instead.
If you run `git difftool` instead of `git diff`, you can view any of these diffs in software like Araxis, emerge, vimdiff and more.
Run `git difftool --tool-help` to see what is available on your system.
====

[[_committing_changes]]
Expand Down

0 comments on commit 1d4253b

Please sign in to comment.