Skip to content

Commit 60d6cd1

Browse files
committed
git branch command
1 parent bf20fba commit 60d6cd1

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

book/03-git-branching/sections/branch-management.asc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[_branch_management]]
12
=== Branch Management
23

34
(((branches, managing)))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The only reason nearly every repository has one is that the `git init` command c
4545
.A branch and its commit history
4646
image::images/branch-and-history.png[A branch and its commit history.]
4747

48+
[[_create_new_branch]]
4849
==== Creating a new branch
4950

5051
(((branches, creating)))

book/03-git-branching/sections/remote-branches.asc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Switched to a new branch 'serverfix'
117117

118118
This gives you a local branch that you can work on that starts where `origin/serverfix` is.
119119

120+
[[_tracking_branches]]
120121
==== Tracking Branches
121122

122123
(((branches, tracking)))(((branches, upstream)))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[_git_refs]]
12
=== Git References
23

34
You can run something like `git log 1a410e` to look through your whole history, but you still have to remember that `1a410e` is the last commit in order to walk that history to find all those objects.

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,22 @@ We only briefly mention this command in <<_git_mv>>.
143143

144144
=== Branching and Merging
145145

146+
There are just a handful of commands that implement most of the branching and merging functionality in Git.
146147

147148
==== git branch
148149

150+
The `git branch` command is actually something of a branch management tool. It can list the branches you have, create a new branch, delete branches and rename branches.
151+
152+
Most of <<_git_branching>> is dedicated to the `branch` command and it's used throughout the entire chapter. We first introduce it in <<_create_new_branch>> and we go through most of it's other features (listing and deleting) in <<_branch_management>>.
153+
154+
In <<_tracking_branches>> we use the `git branch -u` option to set up a tracking branch.
155+
156+
Finally, we go through some of what it does in the background in <<_git_refs>>.
157+
149158
==== git checkout
150159

160+
The `git checkout` command is used to switch branches and check content out into your working directory.
161+
151162
==== git merge
152163

153164
==== git mergetool

0 commit comments

Comments
 (0)