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/01-introduction/sections/about-version-control.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ It is easy to forget which directory you're in and accidentally write to the wro
19
19
20
20
To deal with this issue, programmers long ago developed local VCSs that had a simple database that kept all the changes to files under revision control.
21
21
22
-
.Local version control
22
+
.Local version control diagram
23
23
image::images/local.png[Local version control diagram]
24
24
25
25
One of the most popular VCS tools was a system called RCS, which is still distributed with many computers today.
@@ -33,7 +33,7 @@ To deal with this problem, Centralized Version Control Systems (CVCSs) were deve
33
33
These systems (such as CVS, Subversion, and Perforce) have a single server that contains all the versioned files, and a number of clients that check out files from that central place. (((CVS)))(((Subversion)))(((Perforce)))
34
34
For many years, this has been the standard for version control.
35
35
36
-
.Centralized version control
36
+
.Centralized version control diagram
37
37
image::images/centralized.png[Centralized version control diagram]
38
38
39
39
This setup offers many advantages, especially over local VCSs.
@@ -54,7 +54,7 @@ In a DVCS (such as Git, Mercurial, Bazaar or Darcs), clients don't just check ou
54
54
Thus, if any server dies, and these systems were collaborating via that server, any of the client repositories can be copied back up to the server to restore it.
55
55
Every clone is really a full backup of all the data.
56
56
57
-
.Distributed version control
57
+
.Distributed version control diagram
58
58
image::images/distributed.png[Distributed version control diagram]
59
59
60
60
Furthermore, many of these systems deal pretty well with having several remote repositories they can work with, so you can collaborate with different groups of people in different ways simultaneously within the same project.
Copy file name to clipboardExpand all lines: book/03-git-branching/sections/rebasing.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,20 +151,20 @@ Suppose you clone from a central server and then do some work off that.
151
151
Your commit history looks like this:
152
152
153
153
.Clone a repository, and base some work on it
154
-
image::images/perils-of-rebasing-1.png["Clone a repository, and base some work on it."]
154
+
image::images/perils-of-rebasing-1.png["Clone a repository, and base some work on it"]
155
155
156
156
Now, someone else does more work that includes a merge, and pushes that work to the central server.
157
157
You fetch it and merge the new remote branch into your work, making your history look something like this:
158
158
159
159
.Fetch more commits, and merge them into your work
160
-
image::images/perils-of-rebasing-2.png["Fetch more commits, and merge them into your work."]
160
+
image::images/perils-of-rebasing-2.png["Fetch more commits, and merge them into your work"]
161
161
162
162
Next, the person who pushed the merged work decides to go back and rebase their work instead; they do a `git push --force` to overwrite the history on the server.
163
163
You then fetch from that server, bringing down the new commits.
164
164
165
165
[[_pre_merge_rebase_work]]
166
166
.Someone pushes rebased commits, abandoning commits you've based your work on
167
-
image::images/perils-of-rebasing-3.png["Someone pushes rebased commits, abandoning commits you've based your work on."]
167
+
image::images/perils-of-rebasing-3.png["Someone pushes rebased commits, abandoning commits you've based your work on"]
168
168
169
169
Now you're both in a pickle.
170
170
If you do a `git pull`, you'll create a merge commit which includes both lines of history, and your repository will look like this:
Copy file name to clipboardExpand all lines: book/03-git-branching/sections/remote-branches.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ If you run `git clone -o booyah` instead, then you will have `booyah/master` as
28
28
====
29
29
30
30
.Server and local repositories after cloning
31
-
image::images/remote-branches-1.png[Server and local repositories after cloning.]
31
+
image::images/remote-branches-1.png[Server and local repositories after cloning]
32
32
33
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.
34
34
Also, as long as you stay out of contact with your `origin` server, your `origin/master` pointer doesn't move.
@@ -40,7 +40,7 @@ To synchronize your work with a given remote, you run a `git fetch <remote>` com
40
40
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.
41
41
42
42
.`git fetch` updates your remote-tracking branches
43
-
image::images/remote-branches-3.png[`git fetch` updates your remote references]
43
+
image::images/remote-branches-3.png[`git fetch` updates your remote-tracking branches]
44
44
45
45
To demonstrate having multiple remote servers and what remote branches for those remote projects look like, let's assume you have another internal Git server that is used only for development by one of your sprint teams.
46
46
This server is at `git.team1.ourcompany.com`.
@@ -54,7 +54,7 @@ Now, you can run `git fetch teamone` to fetch everything the remote `teamone` se
54
54
Because that server has a subset of the data your `origin` server has right now, Git fetches no data but sets a remote-tracking branch called `teamone/master` to point to the commit that `teamone` has as its `master` branch.
55
55
56
56
.Remote-tracking branch for `teamone/master`
57
-
image::images/remote-branches-5.png[Remotetracking branch for `teamone/master`]
57
+
image::images/remote-branches-5.png[Remote-tracking branch for `teamone/master`]
Copy file name to clipboardExpand all lines: book/05-distributed-git/sections/maintaining.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
@@ -334,7 +334,7 @@ image::images/merging-workflows-4.png[After a topic branch merge]
334
334
335
335
[[merwf_e]]
336
336
.After a project release
337
-
image::images/merging-workflows-5.png[After a topic branch release]
337
+
image::images/merging-workflows-5.png[After a project release]
338
338
339
339
This way, when people clone your project's repository, they can either check out `master` to build the latest stable version and keep up to date on that easily, or they can check out `develop`, which is the more cutting-edge content.
340
340
You can also extend this concept by having an `integrate` branch where all the work is merged together.
Then select the "`SSH keys`" section along the left-hand side.
39
39
40
-
.The "`SSH keys`" link.
40
+
.The "`SSH keys`" link
41
41
image::images/ssh-keys.png[The “SSH keys” link]
42
42
43
43
From there, click the "`Add an SSH key`" button, give your key a name, paste the contents of your `~/.ssh/id_rsa.pub` (or whatever you named it) public-key file into the text area, and click "`Add key`".
We'll choose a copy of the Git logo that is on our hard drive and then we get a chance to crop it.
61
61
62
-
.Crop your avatar
62
+
.Crop your uploaded avatar
63
63
image::images/avatar-crop.png[Crop your uploaded avatar]
64
64
65
65
Now anywhere you interact on the site, people will see your avatar next to your username.
@@ -72,7 +72,7 @@ The way that GitHub maps your Git commits to your user is by email address.
72
72
If you use multiple email addresses in your commits and you want GitHub to link them up properly, you need to add all the email addresses you have used to the Emails section of the admin section.
73
73
74
74
[[_add_email_addresses]]
75
-
.Add email addresses
75
+
.Add all your email addresses
76
76
image::images/email-settings.png[Add all your email addresses]
77
77
78
78
In <<_add_email_addresses>> we can see some of the different states that are possible.
Copy file name to clipboardExpand all lines: book/06-github/sections/2-contributing.asc
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,7 @@ It is almost always worthwhile to put some effort into this, since a good descri
135
135
We also see a list of the commits in our topic branch that are "`ahead`" of the `master` branch (in this case, just the one) and a unified diff of all the changes that will be made should this branch get merged by the project owner.
When you hit the 'Create pull request' button on this screen, the owner of the project you forked will get a notification that someone is suggesting a change and will link to a page that has all of this information on it.
141
141
@@ -154,22 +154,22 @@ Where this conversation may take place over email in the workflows presented in
154
154
The project owner can review the unified diff and leave a comment by clicking on any of the lines.
155
155
156
156
.Comment on a specific line of code in a Pull Request
157
-
image::images/blink-04-pr-comment.png[PR line comment]
157
+
image::images/blink-04-pr-comment.png[Comment on a specific line of code in a Pull Request]
158
158
159
159
Once the maintainer makes this comment, the person who opened the Pull Request (and indeed, anyone else watching the repository) will get a notification.
160
160
We'll go over customizing this later, but if he had email notifications turned on, Tony would get an email like this:
image::images/blink-04-email.png[Comments sent as email notifications]
165
165
166
166
Anyone can also leave general comments on the Pull Request.
167
167
In <<_pr_discussion>> we can see an example of the project owner both commenting on a line of code and then leaving a general comment in the discussion section.
168
168
You can see that the code comments are brought into the conversation as well.
An interesting thing to notice is that if you click on the "`Files Changed`" tab on this Pull Request, you'll get the "`unified`" diff -- that is, the total aggregate difference that would be introduced to your main branch if this topic branch was merged in.
186
186
In `git diff` terms, it basically automatically shows you `git diff master...<branch>` for the branch this Pull Request is based on.
@@ -229,7 +229,7 @@ GitHub will test this for you and let you know at the bottom of every Pull Reque
229
229
230
230
[[_pr_fail]]
231
231
.Pull Request does not merge cleanly
232
-
image::images/pr-01-fail.png[PR merge failure]
232
+
image::images/pr-01-fail.png[Pull Request does not merge cleanly]
233
233
234
234
If you see something like <<_pr_fail>>, you'll want to fix your branch so that it turns green and the maintainer doesn't have to do extra work.
235
235
@@ -287,7 +287,7 @@ Once you do that, the Pull Request will be automatically updated and re-checked
287
287
288
288
[[_pr_merge_fix]]
289
289
.Pull Request now merges cleanly
290
-
image::images/pr-02-merge-fix.png[PR fixed]
290
+
image::images/pr-02-merge-fix.png[Pull Request now merges cleanly]
291
291
292
292
One of the great things about Git is that you can do that continuously.
293
293
If you have a very long-running project, you can easily merge from the target branch over and over again and only have to deal with conflicts that have arisen since the last time that you merged, making the process very manageable.
@@ -314,13 +314,13 @@ We can fill out the description just like <<_pr_references>>.
image::images/markdown-02-tasks.png[Task lists rendered in a Markdown comment]
374
374
375
375
This is often used in Pull Requests to indicate what all you would like to get done on the branch before the Pull Request will be ready to merge.
376
376
The really cool part is that you can simply click the checkboxes to update the comment -- you don't have to edit the Markdown directly to check tasks off.
@@ -382,7 +382,7 @@ You can see an example of this in <<_task_list_progress>>.
0 commit comments