本文介绍的是是Github的一些基本使用,具体可以看下面网站:
具体学习其他内容,可以参看这个网站
1.Github是什么
Github是一个开源代码托管库,在这里面你会发现整个项目的文件,并进行download下来使用,是很多大牛人所使用的地方。
GitHub is a code hosting platform for version control and collaboration.
Github是一个版本控制和协作的代码托管平台。
2.Github是怎么样工作的
需要了解这些-repositories, branches, commits, Fork and Pull Requests.
Step 1. Create a Repository(创建一个仓库)
Repository是组织单个项目。
Repository可以包含:
folders and files(文件夹和文件)
images
videos
spreadsheets(电子表格)
README文件(介绍你的项目信息)README.md文件 用markdown工具写的
and data sets – anything your project needs. (数据集-任何你的项目所需要的)
Repository最好是含有一个README文件, or a file with information about your project.
To create a new Repository(如何创建一个新的仓库)
1.进入自己的主页,点击右上角的+,选择new Repository.
2.点击之后,会进入下面的页面,然后填好Repository的name,关于这个Repository的description,以及如下操作
3.选择Initialize this repository with a README.
4.点击Create Repository.

Step 2. Create a Branch
为什么会有创建分支呢?
因为我们对于一个文件进行多次改动,会产生不同版本,产生多个文件,那么分支就可以把这些不同版本合并成第一个里面。
分支是一次处理不同版本存储库的方法。
默认情况下你的Repository会有一个分支叫做master,这个也是最终的branch.
在提交到master之前,我们会有很多分支做实验和编辑。
下面是从master中创建分支,然后进行改变,请求合并,审核,合并到master的过程:

To create a new branch(如何创建一个新的分支):
1.转向你的新的仓库-hello-world。
2.点击在文件的上部有个下拉列表-branch:master。
3.在下拉框下 输入新的分支名字readme-edits,转到新的分支框
4.选择下面提示蓝色框上的Create branch:readme-edits或者点击“Enter”键。

现在你有两个分支master和readme-edits.这两个文件完全一样,但不会太久。接下来我们在新的分支里作出修改。
Step 3. Make and commit changes
注:现在处于readme-edits的代码视图,你可以进行下编辑。
在Github下,保存改变叫做commits(提交)。每个提交都有一个关联的commit messages(提交信息),记录着为什么作出改变。commit messages记录着你的历史的改变,让其他贡献者会明白你做了什么和你为什么这么做。
Make and commit changes(如何改变和提交)
1.点击README.md文件
2.点击右上角的pencil(铅笔)图标进行编辑。
3.写你的改变和写一个提交信息说明你作出了什么改变。
4.点击commit changes。


现在的改变只是改变了readme-edits分支下的README.md文件,所以现在这个分支包含的内容与master分支是不同的。
Step 4. Open a Pull Request(打开下拉请求)
在进行了上面的编辑,你就可以进行一个下拉请求了。
你进行了下拉请求,就会做出你的贡献,有人会去审核你的贡献并把它合并到这个人的分支上。
在这个文件里会有颜色的区别,红色代表原文件,绿色代表你的修改。
你可以在你的Github中 @mention system(@你提及的系统-为了评价你的系统 例如facebook )在下拉请求下,就可以让其他团队进行反馈.
你甚至可以在自己的存储库中打开拉请求并自己合并它们。
Open a Pull Request for changes to the README(如何下拉请求)
Click the Pull Request tab, then from the Pull Request page, click the green New pull request button.(单击下拉请求板面,然后从下拉列表下选择New pull request )

In the Example Comparisons box, select the branch you made, readme-edits, to compare with master (the original).(在Example Comparisons板面下,选择你改变的分支与原分支master做比较)

Look over your changes in the diffs on the Compare page, make sure they’re what you want to submit.(查看你的改变,确保这个是你要提交的。)

When you’re satisfied that these are the changes you want to submit, click the big green Create Pull Request button.(当你确定后,点击Create Pull Request 。)

Give your pull request a title and write a brief description of your changes.

When you’re done with your message, click Create pull request!
Tip: You can use emoji and drag and drop images and gifs onto comments and Pull Requests.
Step 5. Merge your Pull Request(合并你的下拉请求)
在最后一步中,将你的readme-edits分支合并入master分支。
1.单击绿色合并拉请求按钮将更改合并为master.
2.点击确认合并.
3.继续删除分支,因为它的更改已被合并,点击Delete branch 。
想了解更多关于Pull Request的问题,请看这个网站:
到目前为止就学习完了如何使用Github.
在你的Github主页里,你会看到你的贡献值—contribution squares。
有关贡献的问题请看下面的网站:
https://help.github.com/en/articles/viewing-contributions-on-your-profile