GitHub创建开源hello-world

  • 1.Create a Repository(创建一个仓库)
    • To create a new repository(具体的做法)
  • 2.Create a Branch(创建一个分支)
    • To create a new branch(创建一个新分支)
  • 3.Make and commit changes(制作并提交更改)
  • 4.Open a Pull Request(打开拉取请求)
    • Open a Pull Request for changes to the README(给READNME打开一个拉取请求)
  • 5.Merge your Pull Request(合并你的pull请求)
  • Celebrate!

1.Create a Repository(创建一个仓库)

A repository is usually used to organize a single project. Repositories can contain folders and files, images, videos, spreadsheets, and data sets – anything your project needs. We recommend including a README, or a file with information about your project. GitHub makes it easy to add one at the same time you create your new repository. It also offers other common options such as a license file.
Your hello-world repository can be a place where you store ideas, resources, or even share and discuss things with others.

存储库通常用于组织单个项目。 存储库可以包含文件夹和文件,图像,视频,电子表格和数据集 - 您的项目需要的任何内容。 我们建议包括README或包含项目信息的文件。 GitHub可以在创建新存储库的同时轻松添加一个。 它还提供其他常见选项,例如许可证文件。

您的hello-world存储库可以是存储想法,资源,甚至与他人共享和讨论事物的地方。

To create a new repository(具体的做法)

1. In the upper right corner, next to your avatar or identicon, click and then select New repository.
2. Name your repository hello-world.
3. Write a short description.
4. Select Initialize this repository with a README.

  1. 在右上角,在您的头像或identicon旁边,单击,然后选择新建存储库。
  2. 将您的存储库命名为hello-world。
  3. 写一个简短的描述。
  4. 选择使用README文件初始化此存储库。

2.Create a Branch(创建一个分支)

Branching is the way to work on different versions of a repository at one time.

By default your repository has one branch named master which is considered to be the definitive branch. We use branches to experiment and make edits before committing them to master.

When you create a branch off the master branch, you’re making a copy, or snapshot, of master as it was at that point in time. If someone else made changes to the master branch while you were working on your branch, you could pull in those updates.

分支是一次在不同版本的存储库上工作的方式。

默认情况下,您的存储库有一个名为master的分支,它被认为是权威分支。 在将它们提交给master之前,我们使用分支进行实验并进行编辑

当您从主分支创建分支时,您正在制作主分支的副本或快照,就像在那个时间点那样。 如果其他人在您的分支机构上工作时对主分支进行了更改,则可以引入这些更新。最后所有的更新都会合并到这个分支奥

This diagram shows:

  • The master branch
  • A new branch called feature (because we’re doing ‘feature work’ on this branch)
  • The journey that feature takes before it’s merged into master

该图显示:

  • 主分支
  • 一个名为feature的新分支(因为我们在这个分支上做’功能工作’)
  • 功能在合并到主服务器之前所经历的旅程

    Have you ever saved different versions of a file? Something like:
  • story.txt
  • story-joe-edit.txt
  • story-joe-edit-reviewed.txt
  • Branches accomplish similar goals in GitHub repositories.

Here at GitHub, our developers, writers, and designers use branches for keeping bug fixes and feature work separate from our master (production) branch. When a change is ready, they merge their branch into master.

你有没有保存过不同版本的文件?就像是

  • story.txt
  • story-joe-edit.txt
  • story-joe-reviewed.txt
    分支机构在GitHub存储库中实现了类似的目标。

在GitHub,我们的开发人员,编写人员和设计人员使用分支来保持错误修复和功能工作与主(生产)分支分开。 当更改准备就绪时,它们将其分支合并到主服务器中。

To create a new branch(创建一个新分支)

  • Go to your new repository hello-world.
  • Click the drop down at the top of the file list that says branch: master.
  • Type a branch name, readme-edits, into the new branch text box.
  • Select the blue Create branch box or hit “Enter” on your keyboard.
    Now you have two branches, master and readme-edits. They look exactly the same, but not for long! Next we’ll add our changes to the new branch.

转到新的存储库hello-world。
单击文件列表顶部的下拉列表:master:master。
在新分支文本框中键入分支名称readme-edits。
选择蓝色的创建分支框或按键盘上的“Enter”。
现在你有两个分支,master和readme-edits。它们看起来完全一样,但时间不长!接下来,我们将更改添加到新分支。

3.Make and commit changes(制作并提交更改)

Bravo! Now, you’re on the code view for your readme-edits branch, which is a copy of master. Let’s make some edits.

On GitHub, saved changes are called commits. Each commit has an associated commit message, which is a description explaining why a particular change was made. Commit messages capture the history of your changes, so other contributors can understand what you’ve done and why.

好样的! 现在,您正在阅读readme-edits分支的代码视图,该分支是master的副本。 我们来做一些编辑。

在GitHub上,保存的更改称为提交。 每个提交都有一个关联的提交消息,这是一个解释为什么进行特定更改的描述。 提交消息可捕获更改的历史记录,因此其他贡献者可以了解您已完成的操作和原因。

Make and commit changes

  1. Click the README.md file.
  2. Click the pencil icon in the upper right corner of the file view to edit.
  3. In the editor, write a bit about yourself.
  4. Write a commit message that describes your changes.
  5. Click Commit changes button.

制作并提交更改

  • 单击README.md文件
  • 单击文件视图右上角的铅笔图标进行编辑。
  • 在编辑器中,写下一些关于你自己的内容
  • 编写描述更改的提交消息。
  • 单击提交更改按钮。

    These changes will be made to just the README file on your readme-edits branch, so now this branch contains content that’s different from master.

这些更改将仅对readme-edits分支上的README文件进行,因此现在此分支包含的内容与master不同。

更改完后的样子。

4.Open a Pull Request(打开拉取请求)

Nice edits! Now that you have changes in a branch off of master, you can open a pull request.

Pull Requests are the heart of collaboration on GitHub. When you open a pull request, you’re proposing your changes and requesting that someone review and pull in your contribution and merge them into their branch. Pull requests show diffs, or differences, of the content from both branches. The changes, additions, and subtractions are shown in green and red.

As soon as you make a commit, you can open a pull request and start a discussion, even before the code is finished.

By using GitHub’s @mention system in your pull request message, you can ask for feedback from specific people or teams, whether they’re down the hall or 10 time zones away.

You can even open pull requests in your own repository and merge them yourself. It’s a great way to learn the GitHub flow before working on larger projects.

很好的编辑! 现在您在master的分支中有更改,您可以打开pull请求。

Pull Requests是GitHub上合作的核心。 当您打开拉取请求时,您提出了更改并请求某人审核并提取您的贡献并将其合并到他们的分支中。 拉请求显示来自两个分支的内容的差异或差异。 更改,添加和减少以绿色和红色显示。

提交后,即使在代码完成之前,您也可以打开拉取请求并开始讨论

通过在拉取请求消息中使用GitHub的@mention系统,您可以询问特定人员或团队的反馈,无论他们是在大厅还是10个时区之外。

您甚至可以在自己的存储库中打开pull请求并自行合并。 在开展大型项目之前,这是学习GitHub流程的好方法。

Open a Pull Request for changes to the README(给READNME打开一个拉取请求)

step screenshots
Click the Pull Request tab, then from the Pull Request page, click the green New pull request button.
In the Example Comparisons box, select the branch you made, readme-edits, to compare with master (the original).
Look over your changes in the diffs on the Compare page, make sure they’re what you want to submit.
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.

上面是GitHub上给的官方教程,但是并不详细,下面我贴出自己的做法

首先点New pull request
然后观察变化

确认的话,点击Create pull request,即你的改变确认了,然后准备向别人发起请求,请求人家同意你的修改

描述具体的原因,点击create pull request,就ok了

5.Merge your Pull Request(合并你的pull请求)

In this final step, it’s time to bring your changes together – merging your readme-edits branch into the master branch.

  • Click the green Merge pull request button to merge the changes into master.
  • Click Confirm merge.
  • Go ahead and delete the branch, since its changes have been incorporated, with the Delete branch button in the purple box.

在最后一步中,是时候将您的更改结合在一起 - 将您的自述编辑分支合并到主分支中。

  • 单击绿色合并拉取请求按钮以将更改合并到主文件中。
  • 单击确认合并
  • 继续删除分支,因为它的更改已合并,紫色框中的删除分支按钮。

Celebrate!

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:

  • Created an open source repository
  • Started and managed a new branch
  • Changed a file and committed those changes to GitHub
  • Opened and merged a Pull Request
  • Take a look at your GitHub profile and you’ll see your new 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.

庆祝!
通过完成本教程,您已经学会了创建项目并在GitHub上发出拉取请求!

以下是您在本教程中完成的内容:

  • 创建了一个开源存储库
  • 开始并管理一个新的分支
  • 更改了文件并将这些更改提交给GitHub
  • 打开并合并了一个Pull Request
  • 看看你的GitHub个人资料,你会看到你的新贡献正方形!

要了解有关Pull请求功能的更多信息,我们建议您阅读GitHub流程指南。 您也可以访问GitHub Explore并参与开源项目。

提示:查看我们的其他指南,YouTube频道和按需培训,了解有关如何开始使用GitHub的更多信息。

希望一起进步和交流!!!有问题留言,我们一起探讨。

github第一次使用--创建hello-world相关推荐

  1. ubuntu18.04.4 中 下载 github 代码 并创建 python 虚拟环境virtualenv

    文章目录 ubuntu18.04.4 中 下载 github 代码 并创建 python 虚拟环境virtualenv 1 安装virtualenv和virtualenvwrapper 2 githu ...

  2. 通过 GitHub Actions 自动创建 Github Release

    通过 GitHub Actions 自动创建 Github Release Intro 在 GitHub 上维护了几个小的开源项目,每次在发布新版本的时候会创建一个 release,这样可以比较方便的 ...

  3. GitHub上如何创建文件夹

    1.登录到个人的GitHub中,进入所要创建文件夹的库中 2.点击"Create new file" 3.在这里输入你要创建的文件夹名称(此时我们创建的其实还是一个文件而不是文件夹 ...

  4. Github从账号创建到上传项目

    目录 1.安装git MAC 上安装Git主要有两种方式 首先查看电脑是否安装Git,终端输入:git 安装过则会输出: iOSDevdeiMac:~ iosdev$ git usage: git [ ...

  5. github个人主页的创建方法

    前往我的主页以获得更好的阅读体验 github个人主页的创建方法 - DearXuan的主页https://blog.dearxuan.com/2021/08/22/github%E4%B8%AA%E ...

  6. 使用当前主流的github管理项目代码(记我的第一次项目创建)

    先创建一个github的账号 网址:https://github.com/ 然后下载一个git工具并安装 网址:https://gitforwindows.org/ 下载安装注册完成后, 创建一个新的 ...

  7. GitHub 高速上手 ---- 创建密钥,连接

    首先要在GitHub上创建一个帐号,因为本地Git仓库和GitHub仓库之间的传输是通过SSH加密的,所以要在本地生成一个私钥和一个密钥 命令,后面跟的邮箱.要跟你自己的:增加输出的位置:能够不用设置 ...

  8. 【Visual Studio 2019】上传代码到 GitHub ( 16.9.2 版本 | 安装 GitHub 扩展插件 | 创建 Git 仓库 | 推送到远程仓库 )

    文章目录 一.安装 GitHub 扩展插件 二.创建 Git 仓库 三.推送到远程仓库 今天将 Visual Studio 2019 从 16.3.6 版本升级到了 16.9.2 版本 , 发现相关操 ...

  9. 【github系列】github代码仓创建及更新

    1.在windows系统客户端安装git工具 2.安装好git后,配置系统环境 安装完git后,将安装路径如:c:\Program Files\Git\bin 添加到系统环境PATH中.此路径下有gi ...

  10. 如何查看GitHub仓库的创建时间

    github上面没有图形化的的介绍仓库创建时间,但是我们可以通过api接口来查询. 例如,我们如果想看openfass仓库的创建时间可以通过下面命令来查询: curl -k https://api.g ...

最新文章

  1. Windows Server 2016 笔记
  2. 深入了解java线程池
  3. shell统计ip访问情况并分析访问日志
  4. Markdown创建页面和目录?
  5. docker安装nginx容器小记
  6. MySQL参数文件位置
  7. 静态路由(实验讲解+配置)
  8. java私聊_【转帖】实现了视频私聊功能
  9. 释放tcp连接的命令是_TCP协议详解
  10. 拓端tecdat|R语言贝叶斯非参数模型:密度估计、非参数化随机效应meta分析心肌梗死数据
  11. yii2 清除asset资源缓存
  12. python裁剪图片并保存_Python PIL:如何保存裁剪后的图像?
  13. Discrete Cosine Transform Network for Guided Depth Map Super-Resolution
  14. GD32F103实战
  15. 我的世界服务器java出错_如何看懂 游戏《Minecraft》的错误报告 客户端/服务端...
  16. Jmeter java取样器实现
  17. 知乎大V推荐!如何在面试中通过工厂模式来给自己加分?圆我大厂梦!
  18. 单调队列java_单调队列单调栈
  19. 工作中遇到的问题之android客户端自动生成带logo的二维码
  20. 微软准备再次裁员2850人 一年之内完成

热门文章

  1. vue.js关于循环出来多个input并让每个input后的修改按钮控制其值
  2. linux mysql 相关操作、问题
  3. Java实现生产者消费者问题与读者写者问题
  4. chrome插件,脚本中实现跨域请求
  5. 关于添加文件删除权限
  6. [ASM] 基础概念
  7. 杭电oj-----叠筐
  8. jmeter 报405错误_jmeter压测报错问题汇总:
  9. python 连接数据库 慢_python自动结束mysql慢查询会话的实例代码
  10. 中常用的数据结构_代码面试需要知道的8种数据结构(附面试题及答案链接)