Skip to content

Translate 06-github 1-github 1-setting-up-account #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions book/06-github/1-github.asc
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
== GitHub

(((GitHub)))
GitHub is the single largest host for Git repositories, and is the central point of collaboration for millions of developers and projects.
A large percentage of all Git repositories are hosted on GitHub, and many open-source projects use it for Git hosting, issue tracking, code review, and other things.
So while it's not a direct part of the Git open source project, there's a good chance that you'll want or need to interact with GitHub at some point while using Git professionally.
GitHub ������ Git �汾���й��̣��dz�ǧ����Ŀ����ߺ���Ŀ�ܹ��������е����ġ�
�󲿷� Git �汾�ⶼ�й��� GitHub���ܶ࿪Դ��Ŀʹ�� GitHub ʵ�� Git �йܡ�����׷�١���������Լ��������顣
���ԣ������ⲻ�� Git ��Դ��Ŀ��ֱ�Ӳ��֣��������Ҫרҵ��ʹ�� Git���㽫���ɱ������ GitHub �򽻵�����������Ȼ��һ�����õ�ѧϰ���ᡣ

This chapter is about using GitHub effectively.
We'll cover signing up for and managing an account, creating and using Git repositories, common workflows to contribute to projects and to accept contributions to yours, GitHub's programmatic interface and lots of little tips to make your life easier in general.
���½�������θ�Ч��ʹ�� GitHub��
���ǽ�ѧϰ���ע��͹����˻���������ʹ�� Git �汾�⡢��������Ŀ���׵�ͨ�������Լ���ν��ܱ��������Լ���Ŀ�Ĺ��ס�GitHub �ı�̽ӿںͺܶ��ܹ�����Щ�������򵥵�С��ʾ��

If you are not interested in using GitHub to host your own projects or to collaborate with other projects that are hosted on GitHub, you can safely skip to <<_git_tools>>.
���������ʹ�� GitHub �й��Լ�����Ŀ���������Ѿ��й��� GitHub �������Ŀ���к���û����Ȥ������ֱ������ <<_git_tools>> ��һ�¡�

[WARNING]
.Interfaces Change
.�ӿڵĸı�
====
It's important to note that like many active websites, the UI elements in these screenshots are bound to change over time. Hopefully the general idea of what we're trying to accomplish here will still be there, but if you want more up to date versions of these screens, the online versions of this book may have newer screenshots.
��Ҫע��һ�㣬ͬ�ܶ��Ծ����վһ�������н�ȡ�Ľ������ʱ����ı䡣ϣ��������ͼ����ĺ���˼��һֱ�Dz���ģ����ǣ��������Ҫ��Щ��ͼ�ĸ��°汾����������߰汾�����и��µĽ�ͼ��
====

include::sections/1-setting-up-account.asc[]
Expand All @@ -27,8 +27,8 @@ include::sections/4-managing-organization.asc[]

include::sections/5-scripting.asc[]

=== Summary
=== �ܽ�

Now you're a GitHub user.
You know how to create an account, manage an organization, create and push to repositories, contribute to other peoples projects and accept contributions from others.
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.
�������Ѿ���һ�� GitHub �û��ˡ�
��֪������δ����˻���������֯�����������Ͱ汾�⡢����˵���Ŀ�ṩ�����Լ����ܱ��˵Ĺ��ס�
����һ���У��㽫ѧϰ����ǿ�����Ĺ��ߣ��Լ��������������֪ʶ����Щ��ʹ���Ϊ������ Git ��ʦ��
96 changes: 48 additions & 48 deletions book/06-github/sections/1-setting-up-account.asc
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
=== Account Setup and Configuration
=== 账户的创建和配置

(((GitHub, user accounts)))
The first thing you need to do is set up a free user account.
Simply visit https://github.com[], choose a user name that isn't already taken, provide an email address and a password, and click the big green ``Sign up for GitHub'' button.
你所需要做的第一件事是创建一个免费账户。
直接访问 https://github.com[],选择一个未被占用的用户名,提供一个电子邮件地址和密码,点击写着``Sign up for GitHub''的绿色大按钮即可。

.The GitHub sign-up form.
image::images/signup.png[The GitHub sign-up form.]
.GitHub 注册表单。
image::images/signup.png[GitHub 注册表单。]

The next thing you'll see is the pricing page for upgraded plans, but it's safe to ignore this for now.
GitHub will send you an email to verify the address you provided.
Go ahead and do this, it's pretty important (as we'll see later).
你将看到的下一个页面是升级计划的价格页面,目前我们可以直接忽略这个页面。
GitHub 会给你提供的邮件地址发送一封验证邮件。
尽快到你的邮箱进行验证,这是非常重要的(我们会在后面了解到这点)。

[NOTE]
[注意]
====
GitHub provides all of its functionality with free accounts, with the limitation that all of your projects are fully public (everyone has read access).
GitHub's paid plans include a set number of private projects, but we won't be covering those in this book.
GitHub 为免费账户提供了完整功能,限制是你的项目都将被完全公开(每个人都具有读权限)。
GitHub 的付费计划可以让你拥有一定数目的私有项目,不过本书将不涉及这部分内容。
====

Clicking the Octocat logo at the top-left of the screen will take you to your dashboard page.
You're now ready to use GitHub.
点击屏幕左上角的 Octocat 图标,你将来到控制面板页面。
现在,你已经做好了使用 GitHub 的准备工作。

==== SSH Access
==== SSH 访问

(((SSH keys, with GitHub)))
As of right now, you're fully able to connect with Git repositories using the `https://` protocol, authenticating with the username and password you just set up.
However, to simply clone public projects, you don't even need to sign up - the account we just created comes into play when we fork projects and push to our forks a bit later.
现在,你完全可以使用 `https://` 协议,通过你刚刚创建的用户名和密码访问 Git 版本库。
但是,如果仅仅克隆公有项目,你甚至不需要注册——刚刚我们创建的账户是为了以后 fork 其它项目,以及推送我们自己的修改。

If you'd like to use SSH remotes, you'll need to configure a public key.
(If you don't already have one, see <<_generate_ssh_key>>.)
Open up your account settings using the link at the top-right of the window:
如果你习惯使用 SSH 远程,你需要配置一个公钥。
(如果你没有公钥,参考 <<_generate_ssh_key>>。)
使用窗口右上角的链接打开你的账户设置:

.The ``Account settings'' link.
image::images/account-settings.png[The ``Account settings'' link.]
.``Account settings''链接。
image::images/account-settings.png[``Account settings''链接。]

Then select the ``SSH keys'' section along the left-hand side.
然后在左侧选择``SSH keys''部分。

.The ``SSH keys'' link.
image::images/ssh-keys.png[The ``SSH keys'' link.]
.``SSH keys''链接。
image::images/ssh-keys.png[``SSH keys''链接。]

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''.
在这个页面点击“`Add an SSH key`”按钮,给你的公钥起一个名字,将你的`~/.ssh/id_rsa.pub`(或者自定义的其它名字)公钥文件的内容粘贴到文本区,然后点击``Add key''

[NOTE]
[注意]
====
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.
确保给你的 SSH 密钥起一个能够记得住的名字。你可以为每一个密钥起名字(例如,“我的笔记本电脑”或者“工作账户”等),以便以后需要吊销密钥时能够方便地区分。
====

[[_personal_avatar]]
==== Your Avatar
==== 头像

Next, if you wish, you can replace the avatar that is generated for you with an image of your choosing. First go to the ``Profile'' tab (above the SSH Keys tab) and click ``Upload new picture''.
下一步,如果愿意的话,你可以将生成的头像换成你喜欢的图片。首先,来到``Profile''标签页(在``SSH Keys''标签页上方),点击``Upload new picture''

.The ``Profile'' link.
image::images/your-profile.png[The ``Profile'' link.]
.``Profile''链接。
image::images/your-profile.png[``Profile''链接。]

We'll chose a copy of the Git logo that is on our hard drive and then we get a chance to crop it.
我们选择了本地磁盘上的一个 Git 图标,上传之后还可以对其进行裁剪。

.Crop your avatar
image::images/avatar-crop.png[Crop your uploaded avatar.]
.裁剪头像
image::images/avatar-crop.png[裁剪已上传的头像。]

Now anywhere you interact on the site, people will see your avatar next to your username.
现在,在网站任意有你参与的位置,人们都可以在你的用户名旁边看到你的头像。

If you happen to have uploaded an avatar to the popular Gravatar service (often used for Wordpress accounts), that avatar will be used by default and you don't need to do this step.
如果你已经把头像上传到了流行的 Gravatar 托管服务(Wordpress 账户经常使用),默认就会使用这个头像,因此,你就不需要进行这一步骤了。

==== Your Email Addresses
==== 邮件地址

The way that GitHub maps your Git commits to your user is by email address. 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.
GitHub 使用用户邮件地址区分 Git 提交。如果你在自己的提交中使用了多个邮件地址,希望 GitHub 可以正确地将它们连接起来,你需要在管理页面的 Emails 部分添加你拥有的所有邮箱地址。

[[_add_email_addresses]]
.Add email addresses
image::images/email-settings.png[Add all your email addresses.]
.添加邮件地址
image::images/email-settings.png[添加所有邮件地址。]

In <<_add_email_addresses>> we can see some of the different states that are possible. The top address is verified and set as the primary address, meaning that is where you'll get any notifications and receipts. The second address is verified and so can be set as the primary if you wish to switch them. The final address is unverified, meaning that you can't make it your primary address. If GitHub sees any of these in commit messages in any repository on the site, it will be linked to your user now.
<<_add_email_addresses>> 中我们可以看到一些不同的状态。顶部的地址是通过验证的,并且被设置为主要地址,这意味着该地址会接收到所有的通知和回复。第二个地址是通过验证的,如果愿意的话,可以将其设置为主要地址。最后一个地址是未通过验证的,这意味着你不能将其设置为主要地址。当 GitHub 发现任意版本库中的任意提交信息包含了这些地址,它就会将其链接到你的账户。

==== Two Factor Authentication
==== 两步验证

Finally, for extra security, you should definitely set up Two-factor Authentication or ``2FA''. Two-factor Authentication is an authentication mechanism that is becoming more and more popular recently to mitigate the risk of your account being compromised if your password is stolen somehow. Turning it on will make GitHub ask you for two different methods of authentication, so that if one of them is compromised, an attacker will not be able to access your account.
最后,为了额外的安全性,你绝对应当设置两步验证,简写为 ``2FA''。两步验证是一种用于降低因你的密码被盗而带来的账户风险的验证机制,现在已经变得越来越流行。开启两步验证,GitHub 会要求你用两种不同的验证方法,这样,即使其中一个被攻破,攻击者也不能访问你的账户。

You can find the Two-factor Authentication setup under the Security tab of your Account settings.
你可以在 Account settings 页面的 Security 标签页中找到 Two-factor Authentication 设置。

.2FA in the Security Tab
image::images/2fa-1.png[2FA in the Security Tab]
.Security 标签页中的 2FA
image::images/2fa-1.png[Security 标签页中的 2FA]

If you click on the ``Set up two-factor authentication'' button, it will take you to a configuration page where you can choose to use a phone app to generate your secondary code (a ``time based one-time password''), or you can have GitHub send you a code via SMS each time you need to log in.
点击``Set up two-factor authentication''按钮,会跳转到设置页面。该页面允许你选择是要在登录时使用手机 app 生成辅助码(一种``基于时间的一次性密码''),还是要 GitHub 通过 SMS 发送辅助码。

After you choose which method you prefer and follow the instructions for setting up 2FA, your account will then be a little more secure and you will have to provide a code in addition to your password whenever you log into GitHub.
选择合适的方法后,按照提示步骤设置 2FA,你的账户会变得更安全,每次登录 GitHub 时都需要提供除密码以外的辅助码。