Skip to content

Commit b4ba2d7

Browse files
committed
Merge remote-tracking branch 'origin/master' into chapter-10
Conflicts: en/book/02-git-basics/chapter2.asc
2 parents 7f907ed + 931ec02 commit b4ba2d7

File tree

22 files changed

+18795
-7161
lines changed

22 files changed

+18795
-7161
lines changed

en/book/01-introduction/chapter1.asc

Lines changed: 210 additions & 92 deletions
Large diffs are not rendered by default.

en/book/02-git-basics/chapter2.asc

Lines changed: 1283 additions & 833 deletions
Large diffs are not rendered by default.

en/book/03-git-branching/chapter3.asc

Lines changed: 746 additions & 346 deletions
Large diffs are not rendered by default.

en/book/04-git-server/chapter4.asc

Lines changed: 458 additions & 111 deletions
Large diffs are not rendered by default.

en/book/05-distributed-git/chapter5.asc

Lines changed: 487 additions & 134 deletions
Large diffs are not rendered by default.

en/book/06-github/chapter6.asc

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,53 @@
11
== GitHub
22

3-
GitHub is slightly different than most code-hosting sites in the way that it namespaces projects. Instead of being primarily based on the project, GitHub is user centric. That means when I host my `grit` project on GitHub, you won’t find it at `github.com/grit` but instead at `github.com/schacon/grit`. There is no canonical version of any project, which allows a project to move from one user to another seamlessly if the first author abandons the project.
3+
GitHub is slightly different than most code-hosting sites in the way that it namespaces projects.
4+
Instead of being primarily based on the project, GitHub is user centric.
5+
That means when I host my `grit` project on GitHub, you won’t find it at `github.com/grit` but instead at `github.com/schacon/grit`.
6+
There is no canonical version of any project, which allows a project to move from one user to another seamlessly if the first author abandons the project.
47

5-
GitHub is also a commercial company that charges for accounts that maintain private repositories, but anyone can quickly get a free account to host as many open source projects as they want. We’ll quickly go over how that is done.
8+
GitHub is also a commercial company that charges for accounts that maintain private repositories, but anyone can quickly get a free account to host as many open source projects as they want.
9+
We’ll quickly go over how that is done.
610

711
=== Setting Up a User Account
812

9-
The first thing you need to do is set up a free user account. If you visit the Pricing and Signup page at `http://github.com/plans` and click the "Sign Up" button on the Free account (see figure 4-2), you’re taken to the signup page.
13+
The first thing you need to do is set up a free user account.
14+
If you visit the Pricing and Signup page at `http://github.com/plans` and click the ``Sign Up'' button on the Free account (see figure 4-2), you’re taken to the signup page.
1015

1116
image::images/18333fig0402-tn.png[Figure 4-2. The GitHub plan page.]
1217

1318
Here you must choose a username that isn’t yet taken in the system and enter an e-mail address that will be associated with the account and a password (see Figure 4-3).
1419

1520
image::images/18333fig0403-tn.png[Figure 4-3. The GitHub user signup form.]
1621

17-
If you have it available, this is a good time to add your public SSH key as well. We covered how to generate a new key in <<_generating_your_ssh_public_key>>. Take the contents of the public key of that pair, and paste it into the SSH Public Key text box. Clicking the "explain ssh keys" link takes you to detailed instructions on how to do so on all major operating systems.
18-
Clicking the "I agree, sign me up" button takes you to your new user dashboard (see Figure 4-4).
22+
If you have it available, this is a good time to add your public SSH key as well.
23+
We covered how to generate a new key in <<_generating_your_ssh_public_key>>.
24+
Take the contents of the public key of that pair, and paste it into the SSH Public Key text box.
25+
Clicking the ``explain ssh keys'' link takes you to detailed instructions on how to do so on all major operating systems.
26+
Clicking the ``I agree, sign me up'' button takes you to your new user dashboard (see Figure 4-4).
1927

2028
image::images/18333fig0404-tn.png[Figure 4-4. The GitHub user dashboard.]
2129

2230
Next you can create a new repository.
2331

2432
=== Creating a New Repository
2533

26-
Start by clicking the "create a new one" link next to Your Repositories on the user dashboard. You’re taken to the Create a New Repository form (see Figure 4-5).
34+
Start by clicking the ``create a new one'' link next to Your Repositories on the user dashboard.
35+
You’re taken to the Create a New Repository form (see Figure 4-5).
2736

2837
image::images/18333fig0405-tn.png[Figure 4-5. Creating a new repository on GitHub.]
2938

30-
All you really have to do is provide a project name, but you can also add a description. When that is done, click the "Create Repository" button. Now you have a new repository on GitHub (see Figure 4-6).
39+
All you really have to do is provide a project name, but you can also add a description.
40+
When that is done, click the ``Create Repository'' button.
41+
Now you have a new repository on GitHub (see Figure 4-6).
3142

3243
image::images/18333fig0406-tn.png[Figure 4-6. GitHub project header information.]
3344

3445
Since you have no code there yet, GitHub will show you instructions for how create a brand-new project, push an existing Git project up, or import a project from a public Subversion repository (see Figure 4-7).
3546

3647
image::images/18333fig0407-tn.png[Figure 4-7. Instructions for a new repository.]
3748

38-
These instructions are similar to what we’ve already gone over. To initialize a project if it isn’t already a Git project, you use
49+
These instructions are similar to what we’ve already gone over.
50+
To initialize a project if it isn’t already a Git project, you use
3951

4052
$ git init
4153
$ git add .
@@ -46,62 +58,89 @@ When you have a Git repository locally, add GitHub as a remote and push up your
4658
$ git remote add origin [email protected]:testinguser/iphone_project.git
4759
$ git push origin master
4860

49-
Now your project is hosted on GitHub, and you can give the URL to anyone you want to share your project with. In this case, it’s `http://github.com/testinguser/iphone_project`. You can also see from the header on each of your project’s pages that you have two Git URLs (see Figure 4-8).
61+
Now your project is hosted on GitHub, and you can give the URL to anyone you want to share your project with.
62+
In this case, it’s `http://github.com/testinguser/iphone_project`.
63+
You can also see from the header on each of your project’s pages that you have two Git URLs (see Figure 4-8).
5064

5165
image::images/18333fig0408-tn.png[Figure 4-8. Project header with a public URL and a private URL.]
5266

53-
The Public Clone URL is a public, read-only Git URL over which anyone can clone the project. Feel free to give out that URL and post it on your web site or what have you.
67+
The Public Clone URL is a public, read-only Git URL over which anyone can clone the project.
68+
Feel free to give out that URL and post it on your web site or what have you.
5469

55-
The Your Clone URL is a read/write SSH-based URL that you can read or write over only if you connect with the SSH private key associated with the public key you uploaded for your user. When other users visit this project page, they won’t see that URL—only the public one.
70+
The Your Clone URL is a read/write SSH-based URL that you can read or write over only if you connect with the SSH private key associated with the public key you uploaded for your user.
71+
When other users visit this project page, they won’t see that URL–only the public one.
5672

5773
=== Importing from Subversion
5874

59-
If you have an existing public Subversion project that you want to import into Git, GitHub can often do that for you. At the bottom of the instructions page is a link to a Subversion import. If you click it, you see a form with information about the import process and a text box where you can paste in the URL of your public Subversion project (see Figure 4-9).
75+
If you have an existing public Subversion project that you want to import into Git, GitHub can often do that for you.
76+
At the bottom of the instructions page is a link to a Subversion import.
77+
If you click it, you see a form with information about the import process and a text box where you can paste in the URL of your public Subversion project (see Figure 4-9).
6078

6179
image::images/18333fig0409-tn.png[Figure 4-9. Subversion importing interface.]
6280

63-
If your project is very large, nonstandard, or private, this process probably won’t work for you. In Chapter 7, you’ll learn how to do more complicated manual project imports.
81+
If your project is very large, nonstandard, or private, this process probably won’t work for you.
82+
In Chapter 7, you’ll learn how to do more complicated manual project imports.
6483

6584
=== Adding Collaborators
6685

67-
Let’s add the rest of the team. If John, Josie, and Jessica all sign up for accounts on GitHub, and you want to give them push access to your repository, you can add them to your project as collaborators. Doing so will allow pushes from their public keys to work.
86+
Let’s add the rest of the team.
87+
If John, Josie, and Jessica all sign up for accounts on GitHub, and you want to give them push access to your repository, you can add them to your project as collaborators.
88+
Doing so will allow pushes from their public keys to work.
6889

69-
Click the "edit" button in the project header or the Admin tab at the top of the project to reach the Admin page of your GitHub project (see Figure 4-10).
90+
Click the ``edit'' button in the project header or the Admin tab at the top of the project to reach the Admin page of your GitHub project (see Figure 4-10).
7091

7192
image::images/18333fig0410-tn.png[Figure 4-10. GitHub administration page.]
7293

73-
To give another user write access to your project, click the “Add another collaborator” link. A new text box appears, into which you can type a username. As you type, a helper pops up, showing you possible username matches. When you find the correct user, click the Add button to add that user as a collaborator on your project (see Figure 4-11).
94+
To give another user write access to your project, click the ``Add another collaborator'' link.
95+
A new text box appears, into which you can type a username.
96+
As you type, a helper pops up, showing you possible username matches.
97+
When you find the correct user, click the Add button to add that user as a collaborator on your project (see Figure 4-11).
7498

7599
image::images/18333fig0411-tn.png[Figure 4-11. Adding a collaborator to your project.]
76100

77101
When you’re finished adding collaborators, you should see a list of them in the Repository Collaborators box (see Figure 4-12).
78102

79103
image::images/18333fig0412-tn.png[Figure 4-12. A list of collaborators on your project.]
80104

81-
If you need to revoke access to individuals, you can click the "revoke" link, and their push access will be removed. For future projects, you can also copy collaborator groups by copying the permissions of an existing project.
105+
If you need to revoke access to individuals, you can click the ``revoke'' link, and their push access will be removed.
106+
For future projects, you can also copy collaborator groups by copying the permissions of an existing project.
82107

83108
=== Your Project
84109

85110
After you push your project up or have it imported from Subversion, you have a main project page that looks something like Figure 4-13.
86111

87112
image::images/18333fig0413-tn.png[Figure 4-13. A GitHub main project page.]
88113

89-
When people visit your project, they see this page. It contains tabs to different aspects of your projects. The Commits tab shows a list of commits in reverse chronological order, similar to the output of the `git log` command. The Network tab shows all the people who have forked your project and contributed back. The Downloads tab allows you to upload project binaries and link to tarballs and zipped versions of any tagged points in your project. The Wiki tab provides a wiki where you can write documentation or other information about your project. The Graphs tab has some contribution visualizations and statistics about your project. The main Source tab that you land on shows your project’s main directory listing and automatically renders the README file below it if you have one. This tab also shows a box with the latest commit information.
114+
When people visit your project, they see this page.
115+
It contains tabs to different aspects of your projects.
116+
The Commits tab shows a list of commits in reverse chronological order, similar to the output of the `git log` command.
117+
The Network tab shows all the people who have forked your project and contributed back.
118+
The Downloads tab allows you to upload project binaries and link to tarballs and zipped versions of any tagged points in your project.
119+
The Wiki tab provides a wiki where you can write documentation or other information about your project.
120+
The Graphs tab has some contribution visualizations and statistics about your project.
121+
The main Source tab that you land on shows your project’s main directory listing and automatically renders the README file below it if you have one.
122+
This tab also shows a box with the latest commit information.
90123

91124
=== Forking Projects
92125

93-
If you want to contribute to an existing project to which you don’t have push access, GitHub encourages forking the project. When you land on a project page that looks interesting and you want to hack on it a bit, you can click the "fork" button in the project header to have GitHub copy that project to your user so you can push to it.
126+
If you want to contribute to an existing project to which you don’t have push access, GitHub encourages forking the project.
127+
When you land on a project page that looks interesting and you want to hack on it a bit, you can click the ``fork'' button in the project header to have GitHub copy that project to your user so you can push to it.
94128

95-
This way, projects don’t have to worry about adding users as collaborators to give them push access. People can fork a project and push to it, and the main project maintainer can pull in those changes by adding them as remotes and merging in their work.
129+
This way, projects don’t have to worry about adding users as collaborators to give them push access.
130+
People can fork a project and push to it, and the main project maintainer can pull in those changes by adding them as remotes and merging in their work.
96131

97-
To fork a project, visit the project page (in this case, mojombo/chronic) and click the "fork" button in the header (see Figure 4-14).
132+
To fork a project, visit the project page (in this case, mojombo/chronic) and click the ``fork'' button in the header (see Figure 4-14).
98133

99-
image::images/18333fig0414-tn.png[Figure 4-14. Get a writable copy of any repository by clicking the "fork" button.]
134+
image::images/18333fig0414-tn.png[Figure 4-14. Get a writable copy of any repository by clicking the ``fork'' button.]
100135

101136
After a few seconds, you’re taken to your new project page, which indicates that this project is a fork of another one (see Figure 4-15).
102137

103138
image::images/18333fig0415-tn.png[Figure 4-15. Your fork of a project.]
104139

105140
=== GitHub Summary
106141

107-
That’s all we’ll cover about GitHub, but it’s important to note how quickly you can do all this. You can create an account, add a new project, and push to it in a matter of minutes. If your project is open source, you also get a huge community of developers who now have visibility into your project and may well fork it and help contribute to it. At the very least, this may be a way to get up and running with Git and try it out quickly.
142+
That’s all we’ll cover about GitHub, but it’s important to note how quickly you can do all this.
143+
You can create an account, add a new project, and push to it in a matter of minutes.
144+
If your project is open source, you also get a huge community of developers who now have visibility into your project and may well fork it and help contribute to it.
145+
At the very least, this may be a way to get up and running with Git and try it out quickly.
146+
In the next chapter, you'll learn more powerful tools and tips for dealing with complex situations, which will truly make you a Git master.

0 commit comments

Comments
 (0)