The first project of the GitHub guidebook Hello World

Source: Internet
Author: User

Translation of the first article, translation is not good, you are welcome to amend the comments. (also not finished, the following changes continue to turn ... )

Original address: https://guides.github.com/activities/hello-world/

In the field of computer programming, Hello World is an example of an old brand. Whenever we learn a new thing, we can get a simple exercise through Hello world. Let's start learning about GitHub's Hello world!


GitHub is a platform for project hosting and collaboration. You don't have to worry about data loss on your hard drive, nor do you have time to sync on different computers to manage your projects. Most importantly, GitHub enables software engineering to do a better job in a collaborative, asynchronous workflow.


This tutorial guides you to the following points of GitHub: Repositories code warehouse, branches branch, commits submission, issues problem, and pull requests. (Note: Issue has not known why the translation is good, is able to understand the meaning, but can not be turned. Maybe it's better to turn it into a "topic". )


If you're familiar with these operations, you can go to GitHub. With this Hello-world sample code repository, you can familiarize yourself with the process, and you can also record your good ideas here (or the future code repositories, such as jlord/hello-world), store resource files, Or record some notes, or even discuss them here with others (such as holman/feedback).


Installation and Code free zone

In the following tutorial we are all done with github.com, so you don't need to know the command line, or even need to install Git (this is the software that GitHub uses to record changes to the project). You don't even need to know how to program. However, you need a GitHub account, so if you don't have an account, just register one!

TIP: Open the Guide page in a separate browser window so that you can easily see this tutorial when you follow the steps below.


Creating a code base code base is the most basic unit of GitHub, which usually means a separate project. The code base can protect folders, files, including pictures-anything your project needs. We recommend that each code base contain a file that resembles a readme description item. When you create a new code base, it's easy to choose a Readme file created automatically by GitHub. You can also choose to automatically create other files such as licenses and so on, here we do not consider these for the time being.


To create a new code base specific steps

1. Click the + button next to your user name in the upper-right corner;

2. Naming code base for Hello-world;

3. Write a brief description of the project;

4. Select Automatically Create README (Initialize this repository with a readme);

Click Create code base (created repository). Wow, the code base was created!


Create a new notification issueissue is something you need to be aware of in this code base. It can be a bug, a feature requirement, a problem or something else. On GitHub, you can easily manage an active project by tagging, searching, assigning issue.


Now that you have a code base, it is almost empty for the time being. You can provide more information in the Readme so that others know what the project is about. Come on, create a new issue!


Create a new issue for the Readme

1. Click the Issues tab from the toolbar;

2. Click New Issue (new Issue);

3. Fill in the title and description of the issue


When you are finished, click Submit New Issue (Issue). This issue has a permanent URL that you can use when you close it.

The following is where you edit the Readme file and close the issue.


Create a new branch

Branches are used to work in different parts of a code base at the same time. When you create a code base, it will have a branch called master (the main branch) by default. You can continue to write on this branch, or you can always have only one branch, which is all right. But if you have a new feature or new idea that you want to try, you can create another new branch based on the master branch so that the master branch can keep the current version unchanged.


When you create a branch, you are actually copying the current state of the original branch (like a snapshot). When you make changes on the new branch, if the original branch changes or changes, don't worry, you can always introduce these updates.


In your previous work, you may have saved different versions of a file, such as "Story.txt", "Story-joe-edit.txt", "Story-sue-edit.txt". The branching feature on GitHub is a handy way to accomplish this effect.

On GitHub, developers, coders, and designers all have new branches to tune bugs and add a new feature in the case of retaining the main branch (possibly a product) version. When the new feature is complete or the bug is tuned, the new branch is merged into the main branch.


Steps to create a new branch

1. First to the Hello-world code base page;

2. Then click Branch:master on the top of the file list to open the dropdown box;

3. Enter a branch name, such as Readme-edits;

4. Select the Blue "createbranch" option box, or enter directly.


Choose you have two branches, one is master, and the other is readme-edits. They look the same, but only for the time being! We'll add something to the new branch later.


Submit

The operations that are saved in GitHub are called commits. Submission is a great thing to do because all the submitted versions together are records of the continual improvement of your project.

Each submission has a corresponding commit message, which is typically used to describe why a change was made. With these submissions, you and others can quickly see what changes you have made and why.

You should still be on the Readme-edits branch page, now make some changes!


Steps to commit a change

1. Click on the Readme file;

2. Click the Pencil Style button in the upper right corner of the file bar to edit the file;

3. Write something about yourself in the editing area;

4. Write some information describing the changes you have made.


Click Provide changes (Commit changes). These changes have now been updated to the Readme file of the Readme-edits branch, and the branch and the Master branch contain files and commits that are not the same.


Merging merges is at the heart of GitHub's collaborative work.


The first project of the GitHub guidebook Hello World

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.