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
By opening a pull request to this repository, you agree to provide your work under the [project license](LICENSE.asc).
7
+
Also, you agree to grant such license of your work as is required for the purposes of future print editions to @ben and @schacon.
8
+
Should your changes appear in a printed edition, you'll be included in the [contributors list](book/contributors.asc).
9
+
10
+
## Small Corrections
11
+
12
+
Errata and basic clarifications will be accepted if we agree that they improve the content. You can also open an issue so we can figure out how or if it needs to be addressed.
13
+
14
+
If you've never done this before, the [flow guide](https://guides.github.com/introduction/flow/) might be useful.
15
+
16
+
## Large Rewrites
17
+
18
+
Open an issue for discussion before you start. These changes tend to be very subjective, often only clarifying things for some small percentage of people and it's rarely worth the time to accept them. Professional copy editors have already reviewed this content multiple times so while you may have somewhat better taste and grammar than we do it's unlikely that your prose is going to be *so* much better that it's worth changing vast swaths of text.
19
+
20
+
## Figures
21
+
22
+
The images in this book were generated using [Sketch 3](http://bohemiancoding.com/sketch/), with the [included sketchbook file](diagram-source/progit.sketch).
23
+
24
+
To add a figure:
25
+
26
+
1. Add a page to the sketchbook. Try to use the included symbols wherever possible.
27
+
1. Add a "slice" to your page. Give it a name that matches the destination PNG filename, relative from the root of the source directory.
28
+
1. Make sure your slice is set to export at 3x size.
29
+
30
+
31
+
## Translations
32
+
33
+
Translations to other languages are highly encouraged but handled a little differently than the first edition. We now keep each translation in a separate repository and automatically build the output files through Atlas. This was something that was really difficult in the last edition.
34
+
35
+
Since each translation is a different repository, we can also have different maintainers for each project. The Pro Git team simply pulls them in and builds them for the translation teams. To get automatic builds, translations repositories will have to be under the [`progit` organization on GitHub](https://github.com/progit).
36
+
37
+
You can find out information on all the current translations and information on how to start your own at http://progit.org/translations.
Copy file name to clipboardExpand all lines: README.asc
+3-25Lines changed: 3 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,7 @@ Like the first edition, the second edition of Pro Git is open source under a Cre
8
8
9
9
A couple of things have changed since open sourcing the first edition. For one, we've moved from Markdown to the amazing Asciidoc format for the text of the book. We've also moved to using O'Reilly's https://atlas.oreilly.com[Atlas platform] for generating continuous builds of the book so all major formats are always available in every language.
10
10
11
-
We've also moved to keeping the translations in seperate repositories rather than subdirectories of the English repository. See the Translations section for more information.
12
-
13
-
== Contributing
14
-
15
-
To contribute errata or new content to this repository, you will need to open up a Pull Request on GitHub. It is generally a good idea before doing anything major to open an issue and make sure your work will get accepted.
16
-
17
-
Errata and basic clarifications will be accepted if we agree that they improve the content. You can also open an issue so we can figure out how or if it needs to be addressed.
18
-
19
-
Please refrain from making sweeping copy edit changes as they tend to not get accepted and we don't want you wasting your time. These changes tend to be very subjective, often only clarifying things for some small percentage of people and it's rarely worth the time to accept them. Professional copy editors have already reviewed this content multiple times so while you may have somewhat better taste and grammar than we do it's unlikely that your prose is going to be *so* much better that it's worth changing vast swaths of text.
11
+
We've also moved to keeping the translations in separate repositories rather than subdirectories of the English repository. See the Translations section for more information.
20
12
21
13
== How To Generate the Book
22
14
@@ -43,20 +35,6 @@ Converting to PDF...
43
35
44
36
This uses the `asciidoctor`, `asciidoctor-pdf` and `asciidoctor-epub` projects.
45
37
46
-
== Translations
47
-
48
-
Translations to other languages are highly encouraged but handled a little differently than the first edition. We now keep each translation in a seperate repository and automatically build the output files through Atlas. This was something that was really difficult in the last edition.
49
-
50
-
Since each translation is a different repository, we can also have different maintainers for each project. The Pro Git team simply pulls them in and builds them for the translation teams. To get automatic builds, translations repositories will have to be under the https://github.com/progit[progit organization on GitHub].
51
-
52
-
You can find out information on all the current translations and information on how to start your own at: http://progit.org/translations[].
53
-
54
-
== Figures
55
-
56
-
The images in this book were generated using http://bohemiancoding.com/sketch/[Sketch 3], with the link:diagram-source/progit.sketch[included sketchbook file].
57
-
58
-
To add a figure:
38
+
== Contributing
59
39
60
-
. Add a page to the sketchbook. Try to use the included symbols wherever possible.
61
-
. Add a ``slice'' to your page. Give it a name that matches the destination PNG filename, relative from the root of the source directory.
62
-
. Make sure your slice is set to export at 3x size.
40
+
If you'd like to help out by making a change or contributing a translation, take a look at the link:CONTRIBUTING.md[contributor's guide].
Copy file name to clipboardExpand all lines: book/03-git-branching/sections/remote-branches.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
@@ -85,7 +85,7 @@ If you didn't want it to be called `serverfix` on the remote, you could instead
85
85
====
86
86
If you're using an HTTPS URL to push over, the Git server will ask you for your username and password for authentication. By default it will prompt you on the terminal for this information so the server can tell if you're allowed to push.
87
87
88
-
If you don't want to type it every single time you push, you can set up a ``credential cache''. The simplest is just to keep it in memory for a few mintues, which you can easily set up by running `git config --global credential.helper cache`.
88
+
If you don't want to type it every single time you push, you can set up a ``credential cache''. The simplest is just to keep it in memory for a few minutes, which you can easily set up by running `git config --global credential.helper cache`.
89
89
90
90
For more information on the various credential caching options available, see <<_credential_caching>>.
Copy file name to clipboardExpand all lines: book/04-git-server/sections/git-on-a-server.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
@@ -70,7 +70,7 @@ It's important to note that this is literally all you need to do to run a useful
70
70
You're ready to go – nothing else needed.
71
71
72
72
In the next few sections, you'll see how to expand to more sophisticated setups.
73
-
This discussion will include not having to create user accounts for each user, adding public read access to repositories, setting up web UIs, using the Gitosis tool, and more.
73
+
This discussion will include not having to create user accounts for each user, adding public read access to repositories, setting up web UIs and more.
74
74
However, keep in mind that to collaborate with a couple of people on a private project, all you _need_ is an SSH server and a bare repository.
Copy file name to clipboardExpand all lines: book/04-git-server/sections/setting-up-server.asc
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
Let's walk through setting up SSH access on the server side.
5
5
In this example, you'll use the `authorized_keys` method for authenticating your users.
6
6
We also assume you're running a standard Linux distribution like Ubuntu.
7
-
First, you create a 'git' user and a `.ssh` directory for that user.
7
+
First, you create a `git` user and a `.ssh` directory for that user.
8
8
9
9
[source,console]
10
10
----
@@ -52,7 +52,7 @@ Initialized empty Git repository in /opt/git/project.git/
52
52
53
53
Then, John, Josie, or Jessica can push the first version of their project into that repository by adding it as a remote and pushing up a branch.
54
54
Note that someone must shell onto the machine and create a bare repository every time you want to add a project.
55
-
Let's use `gitserver` as the hostname of the server on which you've set up your 'git' user and repository.
55
+
Let's use `gitserver` as the hostname of the server on which you've set up your `git` user and repository.
56
56
If you're running it internally, and you set up DNS for `gitserver` to point to that server, then you can use the commands pretty much as is (assuming that `myproject` is an existing project with files in it):
57
57
58
58
[source,console]
@@ -79,10 +79,10 @@ $ git push origin master
79
79
80
80
With this method, you can quickly get a read/write Git server up and running for a handful of developers.
81
81
82
-
You should note that currently all these users can also log into the server and get a shell as the ``git'' user. If you want to restrict that, you will have to change the shell to something else in the `passwd` file.
82
+
You should note that currently all these users can also log into the server and get a shell as the `git` user. If you want to restrict that, you will have to change the shell to something else in the `passwd` file.
83
83
84
-
You can easily restrict the 'git' user to only doing Git activities with a limited shell tool called `git-shell` that comes with Git.
85
-
If you set this as your 'git' user's login shell, then the 'git' user can't have normal shell access to your server.
84
+
You can easily restrict the `git` user to only doing Git activities with a limited shell tool called `git-shell` that comes with Git.
85
+
If you set this as your `git` user's login shell, then the `git` user can't have normal shell access to your server.
86
86
To use this, specify `git-shell` instead of bash or csh for your user's login shell.
87
87
To do so, you must first add `git-shell` to `/etc/shells` if it's not already there:
88
88
@@ -100,7 +100,7 @@ Now you can edit the shell for a user using `chsh <username>`:
100
100
$ sudo chsh git # and enter the path to git-shell, usually: /usr/bin/git-shell
101
101
----
102
102
103
-
Now, the 'git' user can only use the SSH connection to push and pull Git repositories and can't shell onto the machine.
103
+
Now, the `git` user can only use the SSH connection to push and pull Git repositories and can't shell onto the machine.
104
104
If you try, you'll see a login rejection like this:
105
105
106
106
[source,console]
@@ -112,6 +112,6 @@ Connection to gitserver closed.
112
112
----
113
113
114
114
Now Git network commands will still work just fine but the users won't be able to get a shell.
115
-
As the output states, you can also set up a directory in the ``git'' user's home directory that customizes the `git-shell` command a bit.
115
+
As the output states, you can also set up a directory in the `git` user's home directory that customizes the `git-shell` command a bit.
116
116
For instance, you can restrict the Git commands that the server will accept or you can customize the message that users see if they try to SSH in like that.
117
117
Run `git help shell` for more information on customizing the shell.(((git commands, help)))
Copy file name to clipboardExpand all lines: book/04-git-server/sections/smart-http.asc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ $ a2enmod cgi alias env
16
16
17
17
This also enables the `mod_cgi`, `mod_alias`, and `mod_env` modules, which are all needed for this to work properly.
18
18
19
-
Next we need to add some things to the Apache configuration to run the `githttp-backend` as the handler for anything coming into the `/git` path of your web server.
19
+
Next we need to add some things to the Apache configuration to run the `git-http-backend` as the handler for anything coming into the `/git` path of your web server.
There are tons of ways to have Apache authenticate users, you'll have to choose and implement one of them. This is just the simplest example we could come up with. You'll also almost certainly want to set this up over SSL so all this data is encrypted.
62
62
63
-
We don't want to go too far down the rabbit hole of Apache configuration specifics, since you could well be using a different server or have different authenication needs. The idea is that Git comes with a CGI called `githttp-backend` that when invoked will do all the negotiation to send and receive data over HTTP. It does not implement any authentication itself, but that can easily be controlled at the layer of the web server that invokes it. You can do this with nearly any CGI-capable web server, so go with the one that you know best.
63
+
We don't want to go too far down the rabbit hole of Apache configuration specifics, since you could well be using a different server or have different authentication needs. The idea is that Git comes with a CGI called `git-http-backend` that when invoked will do all the negotiation to send and receive data over HTTP. It does not implement any authentication itself, but that can easily be controlled at the layer of the web server that invokes it. You can do this with nearly any CGI-capable web server, so go with the one that you know best.
Copy file name to clipboardExpand all lines: book/05-distributed-git/sections/contributing.asc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,8 +41,8 @@ The Git project provides a document that lays out a number of good tips for crea
41
41
First, you don't want to submit any whitespace errors.
42
42
Git provides an easy way to check for this – before you commit, run `git diff --check`, which identifies possible whitespace errors and lists them for you.
43
43
44
-
.Output of `git diff -check`.
45
-
image::images/git-diff-check.png[Output of `git diff -check`.]
44
+
.Output of `git diff --check`.
45
+
image::images/git-diff-check.png[Output of `git diff --check`.]
46
46
47
47
If you run that command before committing, you can tell if you're about to commit whitespace issues that may annoy other developers.
Copy file name to clipboardExpand all lines: book/06-github/sections/1-setting-up-account.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
@@ -42,7 +42,7 @@ From there, click the "`Add an SSH key`" button, give your key a name, paste the
42
42
43
43
[NOTE]
44
44
====
45
-
Be sure to name your SSH key something you can remember. You can name each of your keys (eg, "My Laptop" or "Work Account") so that if you need to revoke a key later, you can easily tell which one you're looking for.
45
+
Be sure to name your SSH key something you can remember. You can name each of your keys (e.g. "My Laptop" or "Work Account") so that if you need to revoke a key later, you can easily tell which one you're looking for.
Notice that the full GitHub URL we put in there was shortened to just the information needed.
272
272
273
-
Now if Tony goes back and closes out the original Pull Request, we can see that by mentioning it in the new one, GitHub has automatically created a trackback event in the Pull Request timeline. This means that anyone who visits this Pull Request and sees that it is closed can easily link back to the one that superceded it. The link will look something like <<_pr_closed>>.
273
+
Now if Tony goes back and closes out the original Pull Request, we can see that by mentioning it in the new one, GitHub has automatically created a trackback event in the Pull Request timeline. This means that anyone who visits this Pull Request and sees that it is closed can easily link back to the one that superseded it. The link will look something like <<_pr_closed>>.
Copy file name to clipboardExpand all lines: book/06-github/sections/3-maintaining.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
@@ -60,7 +60,7 @@ Now that you have a project with some code in it and maybe even a few collaborat
60
60
61
61
Pull Requests can either come from a branch in a fork of your repository or they can come from another branch in the same repository. The only difference is that the ones in a fork are often from people where you can't push to their branch and they can't push to yours, whereas with internal Pull Requests generally both parties can access the branch.
62
62
63
-
For these examples, let's assume you are ``tonychacon'' and you've created a new Arudino code project named ``fade''.
63
+
For these examples, let's assume you are ``tonychacon'' and you've created a new Arduino code project named ``fade''.
Once the code is in a place you like and want to merge it in, you can either pull the code down and merge it locally, either with the `git pull <url> <branch>` syntax we saw earlier, or by adding the fork as a remote and fetching and merging.
95
95
96
-
If the merge is trivial, you can also just hit the ``Merge'' buton on the GitHub site. This will do a ``non-fast-forward'' merge, creating a merge commit even if a fast-forward merge was possible. This means that no matter what, every time you hit the merge button, a merge commit is created. As you can see in <<_merge_button>>, GitHub gives you all of this information if you click the hint link.
96
+
If the merge is trivial, you can also just hit the ``Merge'' button on the GitHub site. This will do a ``non-fast-forward'' merge, creating a merge commit even if a fast-forward merge was possible. This means that no matter what, every time you hit the merge button, a merge commit is created. As you can see in <<_merge_button>>, GitHub gives you all of this information if you click the hint link.
97
97
98
98
[[_merge_button]]
99
99
.Merge button and instructions for merging a Pull Request manually.
@@ -245,7 +245,7 @@ Web notifications only exist on GitHub and you can only check them on GitHub. If
If you click on that, you will see a list of all the items you have been notified about, grouped by project. You can filter to the notifications of a specific project by clicking on it's name in the left hand sidebar. You can also acknowledge the notification by clicking the checkmark icon next to any notification, or acknowledge _all_ of the notifictions in a project by clicking the checkmark at the top of the group. There is also a mute button next to each checkmark that you can click to not receive any further notifications on that item.
248
+
If you click on that, you will see a list of all the items you have been notified about, grouped by project. You can filter to the notifications of a specific project by clicking on it's name in the left hand sidebar. You can also acknowledge the notification by clicking the checkmark icon next to any notification, or acknowledge _all_ of the notifications in a project by clicking the checkmark at the top of the group. There is also a mute button next to each checkmark that you can click to not receive any further notifications on that item.
249
249
250
250
All of these tools are very useful for handling large numbers of notifications. Many GitHub power users will simply turn off email notifications entirely and manage all of their notifications through this screen.
0 commit comments