Skip to content

Commit 4fc35b7

Browse files
committed
various smaller changes and syntax
1 parent 0e152e4 commit 4fc35b7

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

book/03-git-branching/1-git-branching.asc

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ Conflicts:
493493

494494
You can modify that message with details about how you resolved the merge if you think it would be helpful to others looking at this merge in the future – why you did what you did, if it's not obvious.
495495

496-
497496
=== Branch Management
498497

499498
Now that you've created, merged, and deleted some branches, let's look at some branch-management tools that will come in handy when you begin using branches all the time.
@@ -509,7 +508,7 @@ $ git branch
509508
testing
510509
----
511510

512-
Notice the `*` character that prefixes the `master` branch: it indicates the branch that you currently have checked out.
511+
Notice the `*` character that prefixes the `master` branch: it indicates the branch that you currently have checked out (i.e., the branch that `HEAD` points to).
513512
This means that if you commit at this point, the `master` branch will be moved forward with your new work.
514513
To see the last commit on each branch, you can run `git branch -v`:
515514

@@ -565,7 +564,7 @@ Because Git uses a simple three-way merge, merging from one branch into another
565564
This means you can have several branches that are always open and that you use for different stages of your development cycle; you can merge regularly from some of them into others.
566565

567566
Many Git developers have a workflow that embraces this approach, such as having only code that is entirely stable in their `master` branch – possibly only code that has been or will be released.
568-
They have another parallel branch named develop or next that they work from or use to test stability – it isn't necessarily always stable, but whenever it gets to a stable state, it can be merged into `master`.
567+
They have another parallel branch named `develop` or `next` that they work from or use to test stability – it isn't necessarily always stable, but whenever it gets to a stable state, it can be merged into `master`.
569568
It's used to pull in topic branches (short-lived branches, like your earlier `iss53` branch) when they're ready, to make sure they pass all the tests and don't introduce bugs.
570569

571570
In reality, we're talking about pointers moving up the line of commits you're making.
@@ -610,13 +609,15 @@ Your history then looks like this:
610609
.History after merging `dumbidea` and `iss91v2`
611610
image::images/18333fig0321-tn.png[History after merging `dumbidea` and `iss91v2`.]
612611

612+
We will go into more detail about the various possible workflows for your Git project in <<_distributed_git>>, so before you decide which branching scheme your next project will use, be sure to read that chapter.
613+
613614
It's important to remember when you're doing all this that these branches are completely local.
614615
When you're branching and merging, everything is being done only in your Git repository – no server communication is happening.
615616

616617
=== Remote Branches
617618

618-
Remote branches are references to the state of branches on your remote repositories.
619-
They're local branches that you can't move; they're moved automatically whenever you do any network communication.
619+
Remote branches are references (pointers) to the state of branches in your remote repositories.
620+
They're local branches that you can't move; they're moved automatically for you whenever you do any network communication.
620621
Remote branches act as bookmarks to remind you where the branches on your remote repositories were the last time you connected to them.
621622

622623
They take the form `(remote)/(branch)`.
@@ -625,8 +626,8 @@ If you were working on an issue with a partner and they pushed up an `iss53` bra
625626

626627
This may be a bit confusing, so let's look at an example.
627628
Let's say you have a Git server on your network at `git.ourcompany.com`.
628-
If you clone from this, Git automatically names it `origin` for you, pulls down all its data, creates a pointer to where its `master` branch is, and names it `origin/master` locally; and you can't move it.
629-
Git also gives you your own `master` branch starting at the same place as origin's `master` branch, so you have something to work from.
629+
If you clone from this, Git's `clone` command automatically names it `origin` for you, pulls down all its data, creates a pointer to where its `master` branch is, and names it `origin/master` locally.
630+
Git also gives you your own local `master` branch starting at the same place as origin's `master` branch, so you have something to work from.
630631

631632
[NOTE]
632633
.``origin'' is not special
@@ -637,14 +638,14 @@ Just like the branch name ``master'' does not have any special meaning in Git, n
637638
.Server and local repositories after cloning
638639
image::images/18333fig0322-tn.png[Server and local repositories after cloning.]
639640

640-
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.
641+
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.
641642
Also, as long as you stay out of contact with your origin server, your `origin/master` pointer doesn't move.
642643

643644
.Local and remote work can diverge
644645
image::images/18333fig0323-tn.png[Local and remote work can diverge.]
645646

646647
To synchronize your work, you run a `git fetch origin` command.
647-
This command looks up which server origin is (in this case, it's `git.ourcompany.com`), fetches any data from it that you don't yet have, and updates your local database, moving your `origin/master` pointer to its new, more up-to-date position.
648+
This command looks up which server ``origin'' is (in this case, it's `git.ourcompany.com`), fetches any data from it that you don't yet have, and updates your local database, moving your `origin/master` pointer to its new, more up-to-date position.
648649

649650
.`git fetch` updates your remote references
650651
image::images/18333fig0324-tn.png[`git fetch` updates your remote references.]
@@ -680,7 +681,7 @@ Delta compression using up to 8 threads.
680681
Compressing objects: 100% (15/15), done.
681682
Writing objects: 100% (24/24), 1.91 KiB | 0 bytes/s, done.
682683
Total 24 (delta 2), reused 0 (delta 0)
683-
To git@github.com:schacon/simplegit.git
684+
To https://github.com/schacon/simplegit
684685
* [new branch] serverfix -> serverfix
685686
----
686687

@@ -700,7 +701,7 @@ remote: Counting objects: 7, done.
700701
remote: Compressing objects: 100% (2/2), done.
701702
remote: Total 3 (delta 0), reused 3 (delta 0)
702703
Unpacking objects: 100% (3/3), done.
703-
From git@github.com:schacon/simplegit
704+
From https://github.com/schacon/simplegit
704705
* [new branch] serverfix -> origin/serverfix
705706
----
706707

@@ -719,7 +720,7 @@ Switched to a new branch 'serverfix'
719720

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

722-
==== Tracking/Upstream Branches
723+
==== Tracking Branches
723724

724725
Checking out a local branch from a remote branch automatically creates what is called a ``tracking branch'' (or sometimes an ``upstream branch'').
725726
Tracking branches are local branches that have a direct relationship to a remote branch.
@@ -748,7 +749,8 @@ Branch sf set up to track remote branch serverfix from origin.
748749
Switched to a new branch 'sf'
749750
----
750751

751-
Now, your local branch sf will automatically push to and pull from origin/serverfix.
752+
Now, your local branch sf will automatically push to and pull from `origin/serverfix`.
753+
752754
If you already have a local branch and want to set it to a remote branch you just pulled down, or want to change the upstream branch you're tracking, you can use the `-u` or `--set-upstream-to` option to `git branch` to explicitly set it at any time.
753755

754756
[source,shell]

0 commit comments

Comments
 (0)