【文章】https://github.com/
https://guides.github.com/activities/hello-world/
一、建立一个新仓库
hello-world
.总结:1)上面第一步后,默认的建立一个master分支存放代码
2)可以再建立一个分支来修改master的代码
3)然后再合并到master代码里面去。
master
分支做出修改,而你正工作在你的分支上,你能(拉进) pull in 这些,更新到你自己的分支上。master
分支feature
新分支,(because we’re doing ‘feature work’ on this branch)feature
分支经历以下几个过程后,然后合并到 master
曾经保存一个文件的不同版本,一些像这样:
story.txt
story-joe-edit.txt
story-joe-edit-reviewed.txt
Branches 完成 GitHub repositories同样的目标。
在GitHub这儿, 我们 developers, writers, and designers 使用分支,使bug代码得到修复,且修复工作和产品分支相互分离。当修改分支代码改好后,他们才合并到master
.
hello-world
.
readme-edits
到文本框里。
master
and readme-edits
.准确说,它们看起来完全一样, 但不会太久!紧接招我们增加我们的改变到新分支上。readme-edits
分支视图里面,是 master
复制品,让我们来开始编辑吧!
在 GitHub, 保存改变叫commits(提交). 每一个commit有一个commit message相连接,它是解释改变的原因. Commit messages 捕获你改变的历史,因此其它贡献者能理解你已经做了什么,理由是什么。
步骤:
README.md
文件.readme-edits
分支下, README文件做了改变, 因此现在这个分支包含的内容和master
不一样。 你已经脱离 master
分支,建立了新分支,且在新分支上做了修改。现在你能打开一个 pull request,向项目建立者提议你的改变,且请求某人审核你的代码,然后能把你拉入到贡献者中,最后合并改变的代码到master分支中。
一旦你提交改变,你能打开一个 pull request ,然后供大家开始讨论, 是不是让你加入到项目中,一直到代码合并到master分支.这一个过程结束。
在你的 pull request 信息中,通过使用GitHub’s @mention system向特定的人或团队发消息。,请求回复,不管他们在哪里。
你甚至能在你自己的仓库中打开pull requests,合并它们. 在开发一个大项目之前,了解GitHub Flow是非常好的方法。
Click on the image for a larger version
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.
把你的readme-edits
分支合并到 master
分支.
master
.
By completing this tutorial, you’ve learned to create a project and make a pull request on GitHub!
Here’s what you accomplished in this tutorial:
看看你的GitHub profile,然后你看见你是新的贡献者 contribution squares!
To learn more about the power of Pull Requests, we recommend reading the GitHub Flow Guide. You might also visit GitHub Explore and get involved in an Open Source project
Tip: Check out our other Guides, YouTube Channel and On-Demand Training for more on how to get started with GitHub.