Skip to content

Commit 5c28555

Browse files
committed
final backported errata
1 parent b079be9 commit 5c28555

File tree

7 files changed

+34
-48
lines changed

7 files changed

+34
-48
lines changed

book/01-introduction/1-introduction.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
== Getting Started
33

44
This chapter will be about getting started with Git.
5-
We will begin at the beginning by explaining some background on version control tools, then move on to how to get Git running on your system and finally how to get it setup to start working with.
6-
At the end of this chapter you should understand why Git is around, why you should use it and you should be all setup to do so.
5+
We will begin by explaining some background on version control tools, then move on to how to get Git running on your system and finally how to get it set up to start working with.
6+
At the end of this chapter you should understand why Git is around, why you should use it and you should be all set up to do so.
77

88
include::sections/about-version-control.asc[]
99

book/01-introduction/sections/basics.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ Staged means that you have marked a modified file in its current version to go i
8484

8585
This leads us to the three main sections of a Git project: the Git directory, the working directory, and the staging area.
8686

87-
.Working directory, staging area, and git directory.
88-
image::images/areas.png[Working directory, staging area, and git directory.]
87+
.Working directory, staging area, and Git directory.
88+
image::images/areas.png[Working directory, staging area, and Git directory.]
8989

9090
The Git directory is where Git stores the metadata and object database for your project.
9191
This is the most important part of Git, and it is what is copied when you clone a repository from another computer.

book/05-distributed-git/sections/contributing.asc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ First, she switches back to her master branch to integrate all this work:
249249
[source,console]
250250
-----
251251
$ git checkout master
252-
Switched to branch "master"
252+
Switched to branch 'master'
253253
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
254254
-----
255255

@@ -325,7 +325,7 @@ She creates a new branch for the feature and does some work on it there:
325325
-----
326326
# Jessica's Machine
327327
$ git checkout -b featureA
328-
Switched to a new branch "featureA"
328+
Switched to a new branch 'featureA'
329329
$ vim lib/simplegit.rb
330330
$ git commit -am 'add limit to log function'
331331
[featureA 3300904] add limit to log function
@@ -440,7 +440,7 @@ Finally, she merges John's work into her own `featureA` branch:
440440
[source,console]
441441
-----
442442
$ git checkout featureA
443-
Switched to branch "featureA"
443+
Switched to branch 'featureA'
444444
$ git merge origin/featureA
445445
Updating 3300904..aad881d
446446
Fast forward

book/07-git-tools/sections/revision-selection.asc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ You can see your reflog by using `git reflog`:
116116
[source,console]
117117
----
118118
$ git reflog
119-
734713b... HEAD@{0}: commit: fixed refs handling, added gc auto, updated
120-
d921970... HEAD@{1}: merge phedders/rdocs: Merge made by recursive.
121-
1c002dd... HEAD@{2}: commit: added some blame and merge stuff
122-
1c36188... HEAD@{3}: rebase -i (squash): updating HEAD
123-
95df984... HEAD@{4}: commit: # This is a combination of two commits.
124-
1c36188... HEAD@{5}: rebase -i (squash): updating HEAD
125-
7e05da5... HEAD@{6}: rebase -i (pick): updating HEAD
119+
734713b HEAD@{0}: commit: fixed refs handling, added gc auto, updated
120+
d921970 HEAD@{1}: merge phedders/rdocs: Merge made by recursive.
121+
1c002dd HEAD@{2}: commit: added some blame and merge stuff
122+
1c36188 HEAD@{3}: rebase -i (squash): updating HEAD
123+
95df984 HEAD@{4}: commit: # This is a combination of two commits.
124+
1c36188 HEAD@{5}: rebase -i (squash): updating HEAD
125+
7e05da5 HEAD@{6}: rebase -i (pick): updating HEAD
126126
----
127127

128128
Every time your branch tip is updated for any reason, Git stores that information for you in this temporary history.

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ When you save and exit the editor, Git rewinds you back to the last commit in th
109109
[source,console]
110110
----
111111
$ git rebase -i HEAD~3
112-
Stopped at 7482e0d... updated the gemspec to hopefully work better
112+
Stopped at f7f3f6d... changed my name a bit
113113
You can amend the commit now, with
114114
115115
git commit --amend
@@ -174,12 +174,19 @@ The script puts helpful instructions in the rebase message:
174174
#
175175
# Commands:
176176
# p, pick = use commit
177+
# r, reword = use commit, but edit the commit message
177178
# e, edit = use commit, but stop for amending
178179
# s, squash = use commit, but meld into previous commit
180+
# f, fixup = like "squash", but discard this commit's log message
181+
# x, exec = run command (the rest of the line) using shell
182+
#
183+
# These lines can be re-ordered; they are executed from top to bottom.
179184
#
180185
# If you remove a line here THAT COMMIT WILL BE LOST.
186+
#
181187
# However, if you remove everything, the rebase will be aborted.
182188
#
189+
# Note that empty commits are commented out
183190
----
184191

185192
If, instead of ``pick'' or ``edit'', you specify ``squash'', Git applies both that change and the change directly before it and makes you merge the commit messages together.

book/07-git-tools/sections/stashing-cleaning.asc

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Your working directory is clean:
4545
----
4646
$ git status
4747
# On branch master
48-
nothing to commit (working directory clean)
48+
nothing to commit, working directory clean
4949
----
5050

5151
At this point, you can easily switch branches and do work elsewhere; your changes are stored on your stack.
@@ -55,8 +55,8 @@ To see which stashes you’ve stored, you can use `git stash list`:
5555
----
5656
$ git stash list
5757
stash@{0}: WIP on master: 049d078 added the index file
58-
stash@{1}: WIP on master: c264051... Revert "added file_size"
59-
stash@{2}: WIP on master: 21d80a5... added number to log
58+
stash@{1}: WIP on master: c264051 Revert "added file_size"
59+
stash@{2}: WIP on master: 21d80a5 added number to log
6060
----
6161

6262
In this case, two stashes were done previously, so you have access to three different stashed works.
@@ -108,8 +108,8 @@ To remove it, you can run `git stash drop` with the name of the stash to remove:
108108
----
109109
$ git stash list
110110
stash@{0}: WIP on master: 049d078 added the index file
111-
stash@{1}: WIP on master: c264051... Revert "added file_size"
112-
stash@{2}: WIP on master: 21d80a5... added number to log
111+
stash@{1}: WIP on master: c264051 Revert "added file_size"
112+
stash@{2}: WIP on master: 21d80a5 added number to log
113113
$ git stash drop stash@{0}
114114
Dropped stash@{0} (364e91f3f268f0900bc3ee613f9f733e82aaed43)
115115
----
@@ -179,34 +179,6 @@ Saved working directory and index state WIP on master: 1b65b17 added the index f
179179
----
180180

181181

182-
==== Un-applying a Stash
183-
184-
In some use case scenarios you might want to apply stashed changes, do some work, but then un-apply those changes that originally came from the stash.
185-
Git does not provide such a `stash unapply` command, but it is possible to achieve the effect by simply retrieving the patch associated with a stash and applying it in reverse:
186-
187-
[source,console]
188-
----
189-
$ git stash show -p stash@{0} | git apply -R
190-
----
191-
192-
Again, if you don’t specify a stash, Git assumes the most recent stash:
193-
194-
[source,console]
195-
----
196-
$ git stash show -p | git apply -R
197-
----
198-
199-
You may want to create an alias and effectively add a `stash-unapply` command to your git.
200-
For example:
201-
202-
[source,console]
203-
----
204-
$ git config --global alias.stash-unapply '!git stash show -p | git apply -R'
205-
$ git stash
206-
$ #... work work work
207-
$ git stash-unapply
208-
----
209-
210182
==== Creating a Branch from a Stash
211183

212184
If you stash some work, leave it there for a while, and continue on the branch from which you stashed the work, you may have a problem reapplying the work.

book/08-customizing-git/sections/attributes.asc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,13 @@ You can set up an attribute like this:
314314
database.xml merge=ours
315315
----
316316

317+
[source,console]
318+
----
319+
And then define a dummy `ours` merge strategy with:
320+
----
321+
322+
$ git config --global merge.ours.driver true
323+
317324
If you merge in the other branch, instead of having merge conflicts with the `database.xml` file, you see something like this:
318325

319326
[source,console]

0 commit comments

Comments
 (0)