Skip to content

Commit 99ada87

Browse files
committed
Merge pull request progit#89 from schacon/appendix-final
Appendix Final
2 parents b865c9b + d3e1176 commit 99ada87

File tree

31 files changed

+657
-88
lines changed

31 files changed

+657
-88
lines changed

book/02-git-basics/sections/recording-changes.asc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,13 @@ index 3cb747f..e445e28 100644
360360
log.size
361361
----
362362

363+
[[_git_difftool]]
364+
[NOTE]
365+
.Git Diff in an External Tool
366+
====
367+
We will continue to use the `git diff` command in various ways throughout the rest of the book. There is another way to look at these diffs if you prefer a graphical or external diff viewing program instead. If you run `git difftool` instead of `git diff`, you can view any of these diffs in software like Araxis, emerge, vimdiff and more. Run `git difftool --tool-help` to see what is available on your system.
368+
====
369+
363370
[[_committing_changes]]
364371
==== Committing Your Changes
365372

book/02-git-basics/sections/remotes.asc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[_remote_repos]]
12
=== Working with Remotes
23

34
To be able to collaborate on any Git project, you need to know how to manage your remote repositories.
@@ -94,7 +95,7 @@ From https://github.com/paulboone/ticgit
9495
Paul's master branch is now accessible locally as `pb/master` – you can merge it into one of your branches, or you can check out a local branch at that point if you want to inspect it.
9596
(We'll go over what branches are and how to use them in much more detail in <<_git_branching>>.)
9697

97-
98+
[[_fetching_and_pulling]]
9899
==== Fetching and Pulling from Your Remotes
99100

100101
As you just saw, to get data from your remote projects, you can run:(((git commands, fetch)))
@@ -116,6 +117,7 @@ If you have a branch set up to track a remote branch (see the next section and <
116117
This may be an easier or more comfortable workflow for you; and by default, the `git clone` command automatically sets up your local master branch to track the remote master branch (or whatever the default branch is called) on the server you cloned from.
117118
Running `git pull` generally fetches data from the server you originally cloned from and automatically tries to merge it into the code you're currently working on.
118119

120+
[[_pushing_remotes]]
119121
==== Pushing to Your Remotes
120122

121123
When you have your project at a point that you want to share, you have to push it upstream.
@@ -132,6 +134,7 @@ If you and someone else clone at the same time and they push upstream and then y
132134
You'll have to pull down their work first and incorporate it into yours before you'll be allowed to push.
133135
See <<_git_branching>> for more detailed information on how to push to remote servers.
134136

137+
[[_inspecting_remote]]
135138
==== Inspecting a Remote
136139

137140
If you want to see more information about a particular remote, you can use the `git remote show [remote-name]` command.(((git commands, remote)))

book/02-git-basics/sections/tagging.asc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[_git_tagging]]
12
=== Tagging
23

34
(((tags)))
@@ -48,6 +49,7 @@ Annotated tags, however, are stored as full objects in the Git database.
4849
They're checksummed; contain the tagger name, e-mail, and date; have a tagging message; and can be signed and verified with GNU Privacy Guard (GPG).
4950
It's generally recommended that you create annotated tags so you can have all this information; but if you want a temporary tag or for some reason don't want to keep the other information, lightweight tags are available too.
5051

52+
[[_annotated_tags]]
5153
==== Annotated Tags
5254

5355
(((tags, annotated)))
@@ -172,6 +174,7 @@ Date: Sun Apr 27 20:43:35 2008 -0700
172174
...
173175
----
174176

177+
[[_sharing_tags]]
175178
==== Sharing Tags
176179

177180
By default, the `git push` command doesn't transfer tags to remote servers.(((git commands, push)))

book/02-git-basics/sections/undoing.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,5 @@ Don't ever use this command unless you absolutely know that you don't want the f
126126
If you would like to keep the changes you've made to that file but still need to get it out of the way for now, we'll go over stashing and branching in <<_git_branching>>; these are generally better ways to go.
127127

128128
Remember, anything that is __committed__ in Git can almost always be recovered.
129-
Even commits that were on branches that were deleted or commits that were overwritten with an `--amend` commit can be recovered (see <<data_recovery>> for data recovery).
129+
Even commits that were on branches that were deleted or commits that were overwritten with an `--amend` commit can be recovered (see <<_data_recovery>> for data recovery).
130130
However, anything you lose that was never committed is likely never to be seen again.

book/02-git-basics/sections/viewing-history.asc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[_viewing_history]]
12
=== Viewing the Commit History
23

34
After you have created several commits, or if you have cloned a repository with an existing commit history, you'll probably want to look back to see what has happened.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ If you run a `git log` when your history looks like this, you'll see two commits
170170
Furthermore, if you push this history back up to the server, you'll reintroduce all those rebased commits to the central server, which can further confuse people.
171171
It's pretty safe to assume that the other developer doesn't want `C4` and `C6` to be in the history; that's why she rebased in the first place.
172172

173+
[[_rebase_rebase]]
173174
==== Rebase when you Rebase
174175

175176
If you *do* find yourself in a situation like this, Git has some further magic that might help you out. If someone on your team force pushes changes that overwrite work that you've based work on, your challenge is to figure out what is yours and what they've rewritten.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Because that server is a subset of the data your `origin` server has right now,
5050
.Remote tracking branch for `teamone/master`
5151
image::images/remote-branches-5.png[Remote tracking branch for `teamone/master`.]
5252

53+
[[_pushing_branches]]
5354
==== Pushing
5455

5556
(((pushing)))
@@ -189,6 +190,7 @@ If you have a tracking branch set up as demonstrated in the last section, either
189190

190191
Generally it's better to simply use the `fetch` and `merge` commands explicitly as the magic of `git pull` can often be confusing.
191192

193+
[[_delete_branches]]
192194
==== Deleting Remote Branches
193195

194196
(((branches, deleting remote)))

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[_contributing_project]]
12
=== Contributing to a Project
23

34
(((contributing)))
@@ -89,6 +90,7 @@ The Git project has well-formatted commit messages – try running `git log --no
8990
In the following examples, and throughout most of this book, for the sake of brevity this book doesn't have nicely-formatted messages like this; instead, we use the `-m` option to `git commit`.
9091
Do as we say, not as we do.
9192

93+
[[_private_team]]
9294
==== Private Small Team
9395

9496
(((contributing, private small team)))
@@ -613,6 +615,7 @@ Now you can send the maintainer a message that you've made the requested changes
613615
.Commit history after `featureBv2` work.
614616
image::images/public-small-3.png[Commit history after `featureBv2` work.]
615617

618+
[[_project_over_email]]
616619
==== Public Project over E-Mail
617620

618621
(((contributing, public large project)))

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ $ git checkout -b sc/ruby_client master
2828

2929
Now you're ready to add your contributed work into this topic branch and determine if you want to merge it into your longer-term branches.
3030

31+
[[_patches_from_email]]
3132
==== Applying Patches from E-mail
3233

3334
(((email, applying patches from)))
@@ -64,6 +65,7 @@ error: ticgit.gemspec: patch does not apply
6465
If there is no output, then the patch should apply cleanly.
6566
This command also exits with a non-zero status if the check fails, so you can use it in scripts if you want.
6667

68+
[[_git_am]]
6769
===== Applying a Patch with `am`
6870

6971
(((git commands, am)))
@@ -353,6 +355,7 @@ When a topic branch has finally been merged into `master`, it's removed from the
353355
The Git project also has a `maint` branch that is forked off from the last release to provide backported patches in case a maintenance release is required.
354356
Thus, when you clone the Git repository, you have four branches that you can check out to evaluate the project in different stages of development, depending on how cutting edge you want to be or how you want to contribute; and the maintainer has a structured workflow to help them vet new contributions.
355357

358+
[[_rebase_cherry_pick]]
356359
===== Rebasing and Cherry Picking Workflows
357360

358361
(((workflows, rebasing and cherry-picking)))
@@ -410,6 +413,7 @@ If you need to, you can interact with the rerere cache using the `git rerere` co
410413
When it's invoked alone, Git checks its database of resolutions and tries to find a match with any current merge conflicts and resolve them (although this is done automatically if `rerere.enabled` is set to `true`).
411414
There are also subcommands to see what will be recorded, to erase specific resolution from the cache, and to clear the entire cache. We will cover rerere in more detail in <<_rerere>>.
412415

416+
[[_tagging_releases]]
413417
==== Tagging Your Releases
414418

415419
(((tags)))(((tags, signing)))
@@ -465,6 +469,7 @@ $ git show maintainer-pgp-pub | gpg --import
465469
They can use that key to verify all your signed tags.
466470
Also, if you include instructions in the tag message, running `git show <tag>` will let you give the end user more specific instructions about tag verification.
467471
472+
[[_build_number]]
468473
==== Generating a Build Number
469474
470475
(((build numbers)))(((git commands, describe)))
@@ -485,6 +490,7 @@ The `git describe` command favors annotated tags (tags created with the `-a` or
485490
You can also use this string as the target of a checkout or show command, although it relies on the abbreviated SHA-1 value at the end, so it may not be valid forever.
486491
For instance, the Linux kernel recently jumped from 8 to 10 characters to ensure SHA-1 object uniqueness, so older `git describe` output names were invalidated.
487492
493+
[[_preparing_release]]
488494
==== Preparing a Release
489495
490496
(((releasing)))(((git commands, archive)))
@@ -509,6 +515,7 @@ $ git archive master --prefix='project/' --format=zip > `git describe master`.zi
509515
510516
You now have a nice tarball and a zip archive of your project release that you can upload to your website or e-mail to people.
511517
518+
[[_the_shortlog]]
512519
==== The Shortlog
513520
514521
(((git commands, shortlog)))

book/06-github/sections/3-maintaining.asc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Pull Requests can either come from a branch in a fork of your repository or they
6262

6363
For these examples, let's assume you are ``tonychacon'' and you've created a new Arudino code project named ``fade''.
6464

65+
[[_email_notifications]]
6566
===== Email Notifications
6667

6768
Someone comes along and makes a change to your code and sends you a Pull Request. You should get an email notifying you about the new Pull Request and it should look something like <<_email_pr>>.
@@ -100,6 +101,7 @@ image::images/maint-02-merge.png[Merge button]
100101

101102
If you decide you don't want to merge it, you can also just close the Pull Request and the person who opened it will be notified.
102103

104+
[[_pr_refs]]
103105
===== Pull Request Refs
104106

105107
If you're dealing with a *lot* of Pull Requests and don't want to add a bunch of remotes or do one time pulls every time, there is a neat trick that GitHub allows you to do. This is a bit of an advanced trick and we'll go over the details of this a bit more in <<_refspec>>, but it can be pretty useful.

0 commit comments

Comments
 (0)