Skip to content

Commit 0be7401

Browse files
committed
git checkout appendix
1 parent 60d6cd1 commit 0be7401

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

book/03-git-branching/sections/nutshell.asc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ f30ab (HEAD, master, testing) add feature #32 - ability to add new
8686

8787
You can see the ``master'' and ``testing'' branches that are right there next to the `f30ab` commit.
8888

89+
[[_switching_branches]]
8990
==== Switching branches
9091

9192
(((branches, switching)))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ You start a new branch based off the current `origin/master` branch, squash the
596596
(((git commands, merge, squash)))
597597
[source,shell]
598598
-----
599-
$ git checkout -b featureBv2 origin/master^{}
599+
$ git checkout -b featureBv2 origin/master
600600
$ git merge --no-commit --squash featureB
601601
# (change implementation)
602602
$ git commit

book/07-git-tools/sections/advanced-merging.asc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ Removing hello.ours.rb
272272
Removing hello.theirs.rb
273273
----
274274

275+
[[_checking_out_conflicts]]
275276
===== Checking Out Conflicts
276277

277278
Perhaps we're not happy with the resolution at this point for some reason, or maybe manually editing one or both sides still didn't work well and we need more context.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ image::images/data-model-4.png[Git directory objects with branch head references
6666

6767
When you run commands like `git branch (branchname)`, Git basically runs that `update-ref` command to add the SHA-1 of the last commit of the branch you’re on into whatever new reference you want to create.
6868

69+
[[_the_head]]
6970
==== The HEAD
7071

7172
The question now is, when you run `git branch (branchname)`, how does Git know the SHA-1 of the last commit?

book/C-git-commands/1-git-commands.asc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,20 @@ Finally, we go through some of what it does in the background in <<_git_refs>>.
159159

160160
The `git checkout` command is used to switch branches and check content out into your working directory.
161161

162+
We first encounter the command in <<_switching_branches>> along with the `git branch` command.
163+
164+
We see how to use it to start tracking branches with the `--track` flag in <<_tracking_branches>>.
165+
166+
We use it to reintroduce file conflicts with `--conflict=diff3` in <<_checking_out_conflicts>>.
167+
168+
We go into closer detail on it's relationship with `git reset` in <<_git_reset>>.
169+
170+
Finally, we go into some implementation detail in <<_the_head>>.
171+
162172
==== git merge
163173

174+
The `git merge` tool is used to merge one or more branches into the branch you have checked out.
175+
164176
==== git mergetool
165177

166178
==== git log

0 commit comments

Comments
 (0)