Skip to content

Commit 4ced138

Browse files
committed
Merge pull request #345 from rmzelle/branch-highlights
Highlight some branch names
2 parents 627a110 + 277bd27 commit 4ced138

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

book/03-git-branching/sections/basic-branching-and-merging.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ All you have to do is switch back to your `master` branch.
6363
However, before you do that, note that if your working directory or staging area has uncommitted changes that conflict with the branch you're checking out, Git won't let you switch branches.
6464
It's best to have a clean working state when you switch branches.
6565
There are ways to get around this (namely, stashing and commit amending) that we'll cover later on, in <<_git_stashing>>.
66-
For now, let's assume you've committed all your changes, so you can switch back to your master branch:
66+
For now, let's assume you've committed all your changes, so you can switch back to your `master` branch:
6767

6868
[source,console]
6969
----
@@ -91,7 +91,7 @@ $ git commit -a -m 'fixed the broken email address'
9191
.Hotfix branch based on `master`
9292
image::images/basic-branching-4.png[Hotfix branch based on `master`.]
9393

94-
You can run your tests, make sure the hotfix is what you want, and merge it back into your master branch to deploy to production.
94+
You can run your tests, make sure the hotfix is what you want, and merge it back into your `master` branch to deploy to production.
9595
You do this with the `git merge` command:(((git commands, merge)))
9696

9797
[source,console]

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ image::images/commits-and-parents.png[Commits and their parents.]
3232

3333
A branch in Git is simply a lightweight movable pointer to one of these commits.
3434
The default branch name in Git is `master`.
35-
As you start making commits, you're given a master branch that points to the last commit you made.
35+
As you start making commits, you're given a `master` branch that points to the last commit you made.
3636
Every time you commit, it moves forward automatically.
3737

3838
[NOTE]
@@ -68,7 +68,7 @@ How does Git know what branch you're currently on?
6868
It keeps a special pointer called `HEAD`.
6969
Note that this is a lot different than the concept of `HEAD` in other VCSs you may be used to, such as Subversion or CVS.
7070
In Git, this is a pointer to the local branch you're currently on.
71-
In this case, you're still on master.
71+
In this case, you're still on `master`.
7272
The `git branch` command only _created_ a new branch – it didn't switch to that branch.
7373

7474
.HEAD pointing to a branch
@@ -92,7 +92,7 @@ You can see the ``master'' and ``testing'' branches that are right there next to
9292

9393
(((branches, switching)))
9494
To switch to an existing branch, you run the `git checkout` command.(((git commands, checkout)))
95-
Let's switch to the new testing branch:
95+
Let's switch to the new `testing` branch:
9696

9797
[source,console]
9898
----
@@ -116,8 +116,8 @@ $ git commit -a -m 'made a change'
116116
.The HEAD branch moves forward when a commit is made
117117
image::images/advance-testing.png[The HEAD branch moves forward when a commit is made.]
118118

119-
This is interesting, because now your testing branch has moved forward, but your master branch still points to the commit you were on when you ran `git checkout` to switch branches.
120-
Let's switch back to the master branch:
119+
This is interesting, because now your `testing` branch has moved forward, but your `master` branch still points to the commit you were on when you ran `git checkout` to switch branches.
120+
Let's switch back to the `master` branch:
121121

122122
[source,console]
123123
----
@@ -128,9 +128,9 @@ $ git checkout master
128128
image::images/checkout-master.png[HEAD moves when you checkout.]
129129

130130
That command did two things.
131-
It moved the HEAD pointer back to point to the master branch, and it reverted the files in your working directory back to the snapshot that master points to.
131+
It moved the HEAD pointer back to point to the `master` branch, and it reverted the files in your working directory back to the snapshot that `master` points to.
132132
This also means the changes you make from this point forward will diverge from an older version of the project.
133-
It essentially rewinds the work you've done in your testing branch so you can go in a different direction.
133+
It essentially rewinds the work you've done in your `testing` branch so you can go in a different direction.
134134

135135
[NOTE]
136136
.Switching branches changes files in your working directory

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ It works by going to the common ancestor of the two branches (the one you're on
3737
.Rebasing the change introduced in `C4` onto `C3`
3838
image::images/basic-rebase-3.png[Rebasing the change introduced in `C4` onto `C3`.]
3939

40-
At this point, you can go back to the master branch and do a fast-forward merge.
40+
At this point, you can go back to the `master` branch and do a fast-forward merge.
4141

4242
[source,console]
4343
----
@@ -72,7 +72,7 @@ Finally, you went back to your server branch and did a few more commits.
7272
image::images/interesting-rebase-1.png[A history with a topic branch off another topic branch.]
7373

7474
Suppose you decide that you want to merge your client-side changes into your mainline for a release, but you want to hold off on the server-side changes until it's tested further.
75-
You can take the changes on client that aren't on server (`C8` and `C9`) and replay them on your master branch by using the `--onto` option of `git rebase`:
75+
You can take the changes on client that aren't on server (`C8` and `C9`) and replay them on your `master` branch by using the `--onto` option of `git rebase`:
7676

7777
[source,console]
7878
----
@@ -85,7 +85,7 @@ It's a bit complex, but the result is pretty cool.
8585
.Rebasing a topic branch off another topic branch
8686
image::images/interesting-rebase-2.png[Rebasing a topic branch off another topic branch.]
8787

88-
Now you can fast-forward your master branch (see <<rbdiag_g>>):
88+
Now you can fast-forward your `master` branch (see <<rbdiag_g>>):
8989

9090
[source,console]
9191
----
@@ -98,7 +98,7 @@ $ git merge client
9898
image::images/interesting-rebase-3.png[Fast-forwarding your master branch to include the client branch changes.]
9999

100100
Let's say you decide to pull in your server branch as well.
101-
You can rebase the server branch onto the master branch without having to check it out first by running `git rebase [basebranch] [topicbranch]` – which checks out the topic branch (in this case, `server`) for you and replays it onto the base branch (`master`):
101+
You can rebase the server branch onto the `master` branch without having to check it out first by running `git rebase [basebranch] [topicbranch]` – which checks out the topic branch (in this case, `server`) for you and replays it onto the base branch (`master`):
102102

103103
[source,console]
104104
----

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you run `git clone -o booyah` instead, then you will have `booyah/master` as
3030
.Server and local repositories after cloning
3131
image::images/remote-branches-1.png[Server and local repositories after cloning.]
3232

33-
If you do some work on your local master branch, and, in the meantime, someone else pushes to `git.ourcompany.com` and updates its `master` branch, then your histories move forward differently.
33+
If you do some work on your local `master` branch, and, in the meantime, someone else pushes to `git.ourcompany.com` and updates its `master` branch, then your histories move forward differently.
3434
Also, as long as you stay out of contact with your origin server, your `origin/master` pointer doesn't move.
3535

3636
.Local and remote work can diverge

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You did a few commits on them and deleted them directly after merging them into
4444
This technique allows you to context-switch quickly and completely – because your work is separated into silos where all the changes in that branch have to do with that topic, it's easier to see what has happened during code review and such.
4545
You can keep the changes there for minutes, days, or months, and merge them in when they're ready, regardless of the order in which they were created or worked on.
4646

47-
Consider an example of doing some work (on `master`), branching off for an issue (`iss91`), working on it for a bit, branching off the second branch to try another way of handling the same thing (`iss91v2`), going back to your master branch and working there for a while, and then branching off there to do some work that you're not sure is a good idea (`dumbidea` branch).
47+
Consider an example of doing some work (on `master`), branching off for an issue (`iss91`), working on it for a bit, branching off the second branch to try another way of handling the same thing (`iss91v2`), going back to your `master` branch and working there for a while, and then branching off there to do some work that you're not sure is a good idea (`dumbidea` branch).
4848
Your commit history will look something like this:
4949

5050
.Multiple topic branches

0 commit comments

Comments
 (0)