You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/02-git-basics/sections/recording-changes.asc
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -360,6 +360,13 @@ index 3cb747f..e445e28 100644
360
360
log.size
361
361
----
362
362
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.
Copy file name to clipboardExpand all lines: book/02-git-basics/sections/remotes.asc
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
[[_remote_repos]]
1
2
=== Working with Remotes
2
3
3
4
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
94
95
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.
95
96
(We'll go over what branches are and how to use them in much more detail in <<_git_branching>>.)
96
97
97
-
98
+
[[_fetching_and_pulling]]
98
99
==== Fetching and Pulling from Your Remotes
99
100
100
101
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 <
116
117
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.
117
118
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.
118
119
120
+
[[_pushing_remotes]]
119
121
==== Pushing to Your Remotes
120
122
121
123
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
132
134
You'll have to pull down their work first and incorporate it into yours before you'll be allowed to push.
133
135
See <<_git_branching>> for more detailed information on how to push to remote servers.
134
136
137
+
[[_inspecting_remote]]
135
138
==== Inspecting a Remote
136
139
137
140
If you want to see more information about a particular remote, you can use the `git remote show [remote-name]` command.(((git commands, remote)))
Copy file name to clipboardExpand all lines: book/02-git-basics/sections/tagging.asc
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
[[_git_tagging]]
1
2
=== Tagging
2
3
3
4
(((tags)))
@@ -48,6 +49,7 @@ Annotated tags, however, are stored as full objects in the Git database.
48
49
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).
49
50
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.
Copy file name to clipboardExpand all lines: book/02-git-basics/sections/undoing.asc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,5 +126,5 @@ Don't ever use this command unless you absolutely know that you don't want the f
126
126
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.
127
127
128
128
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).
130
130
However, anything you lose that was never committed is likely never to be seen again.
Copy file name to clipboardExpand all lines: book/02-git-basics/sections/viewing-history.asc
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
[[_viewing_history]]
1
2
=== Viewing the Commit History
2
3
3
4
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.
Copy file name to clipboardExpand all lines: book/03-git-branching/sections/rebasing.asc
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,7 @@ If you run a `git log` when your history looks like this, you'll see two commits
170
170
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.
171
171
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.
172
172
173
+
[[_rebase_rebase]]
173
174
==== Rebase when you Rebase
174
175
175
176
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.
Copy file name to clipboardExpand all lines: book/05-distributed-git/sections/contributing.asc
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
[[_contributing_project]]
1
2
=== Contributing to a Project
2
3
3
4
(((contributing)))
@@ -89,6 +90,7 @@ The Git project has well-formatted commit messages – try running `git log --no
89
90
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`.
90
91
Do as we say, not as we do.
91
92
93
+
[[_private_team]]
92
94
==== Private Small Team
93
95
94
96
(((contributing, private small team)))
@@ -613,6 +615,7 @@ Now you can send the maintainer a message that you've made the requested changes
613
615
.Commit history after `featureBv2` work.
614
616
image::images/public-small-3.png[Commit history after `featureBv2` work.]
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.
30
30
31
+
[[_patches_from_email]]
31
32
==== Applying Patches from E-mail
32
33
33
34
(((email, applying patches from)))
@@ -64,6 +65,7 @@ error: ticgit.gemspec: patch does not apply
64
65
If there is no output, then the patch should apply cleanly.
65
66
This command also exits with a non-zero status if the check fails, so you can use it in scripts if you want.
66
67
68
+
[[_git_am]]
67
69
===== Applying a Patch with `am`
68
70
69
71
(((git commands, am)))
@@ -353,6 +355,7 @@ When a topic branch has finally been merged into `master`, it's removed from the
353
355
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.
354
356
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.
355
357
358
+
[[_rebase_cherry_pick]]
356
359
===== Rebasing and Cherry Picking Workflows
357
360
358
361
(((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
410
413
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`).
411
414
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>>.
They can use that key to verify all your signed tags.
466
470
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.
467
471
472
+
[[_build_number]]
468
473
==== Generating a Build Number
469
474
470
475
(((build numbers)))(((git commands, describe)))
@@ -485,6 +490,7 @@ The `git describe` command favors annotated tags (tags created with the `-a` or
485
490
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.
486
491
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.
Copy file name to clipboardExpand all lines: book/06-github/sections/3-maintaining.asc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ Pull Requests can either come from a branch in a fork of your repository or they
62
62
63
63
For these examples, let's assume you are ``tonychacon'' and you've created a new Arudino code project named ``fade''.
64
64
65
+
[[_email_notifications]]
65
66
===== Email Notifications
66
67
67
68
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>>.
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.
102
103
104
+
[[_pr_refs]]
103
105
===== Pull Request Refs
104
106
105
107
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