Read Catalogue
- Introduced
- What is GitHub?
- Create a repository
- Create a branch
- Do a Commit
- Open Pull Request
- Merge Pull Requests
First, Introduction
Hello World Project is a long history of computer programming tradition. This is a simple exercise that allows you to start learning when you are learning something new. Let's start using github!
You will learn how to:
- Creating and using repositories
- Start and manage a new branch
- Make changes to the file and push it to GitHub as a commit
- Open and Merge pull requests
second, what is GitHub?
GitHub is a code hosting platform for version control and collaboration. It allows you and others to work together wherever you are.
This tutorial teaches you a basic knowledge of GitHub, such as Storage Library , Branch , Submit and the Pull Request . You'll create your own Hello World repository and learn about GitHub's pull request workflow, which is a popular way to create and check your code.
No coding required
to complete this tutorial, you need to github.com account and Internet access rights. You don't need to know how to encode, use the command line or install Git (based on version control software GitHub).
Tips: Open this guide in a separate browser window (or tab) so that you can see it as you complete the steps in this tutorial.
Step 1: Create a repository
a Library typically used to host a single project. a repository can contain folders and files, images, videos, spreadsheets, and datasets-anything your project requires. we recommend including a readme or a file containing project information.
GitHub can easily add one while creating a new repository. It also provides other common options, such as license files.
you a hello-world
a repository can be a place to store ideas, resources, and even share and discuss things with others.
Create a new repository
- In the upper-right corner, next to your avatar or Identicon, click then select New repository.
- Name your
hello-world
repository .
- Write a short description.
- Select Initialize this repository with the Readme file .
Click Create a repository .
2nd step. Create a branch
Branch is a way to process different versions of a repository at a time.
by default, your repository has a branch master
named Branch , the branch is considered an authoritative branch. We use branches to experiment and edit before committing master
.
When you create a branch master
on a branch office , you are making the master
A copy or snapshot of the point in time . you master
can extract these updates if other people have made changes to the branch while they are working on your branch office .
The graph shows:
- the
master
Branch
- a new branch
feature
called. (because we do ' special work ' on this branch)
feature
it melts before The Journeymaster
have you saved a different version of the file? It's like:
story.txt
story-joe-edit.txt
story-joe-edit-reviewed.txt
Branch offices achieve similar goals in the GitHub repository.
at GitHub, our developers, writers and designers use branches to maintain bug fixes and functionality to work with our master
(production) branches apart . when the changes are ready, they merge their branches into master
.
Create a new branch
- go to the new repository
hello-world
.
- Click the drop-down list at the top of the file list : Master:master .
readme-edits
in the New branch text box Type the name of the branch .
- Select the Blue Create a branch box or press Enter on your keyboard.
Now you have two branches, master
and the readme-edits
. They look exactly the same, but they won't be long! Next, we add the changes to the new branch.
3rd step. Make and submit changes
Good for you ! Now, in the readme-edits
Code View of the branch , this is a copy master
. Let's do some editing.
on GitHub, the saved changes are called Submit . Each commit has an associated commit message , which is a description of why a particular change was made. The commit message captures the history of the change, so other contributors can understand what you've done and why.
make and submit changes
- Click the
README.md
file.
- Click The pencil icon in the upper-right corner of the file view to edit.
- In the editor, write a little bit about yourself.
- Write a commit message that describes the change.
- Click Commit Changes button.
These changes will only readme-edits
the Readme file on the branch , so this branch now contains different content master
.
Step 4. Open Pull Request
Very good editor! Now that you have changes in your branch master
, you can open a pull request .
pull Requests is at the heart of the collaboration on GitHub. when you open a pull request , you make a change and ask someone to review and extract your contributions and merge them into their branch. Pull requests show the difference or difference of content from two branches . changes, additions, and decreases are shown in green and red.
Once submitted, you can open the pull request and start the discussion even before the code is complete.
by using GitHub's @mention system in a pull request message , You can ask for feedback from a specific person or team, Whether they are outside the hall or 10 time zones.
you can even open pull requests in your own repository and merge them yourself. This is a great way to learn about GitHub flow before you start a large project.
Open Pull Request to change the Readme
Click on the image to see a larger map
Step |
|
Click ,   Pull request tab, and from the Pull request page, click the green new Pull Request button. |
|
in "  Example comparison" box, select the branch you created readme-edits to be associated with the master (original) for comparison . |
|
Review the differences in the diff page to make sure that they are the content you want to submit. |
|
If you are satisfied with the changes you are submitting, click the green Create pull Request button. |
|
provide a title for your pull request and write a brief description of your changes. |
|
when the message is complete, click Create pull Request " !
Tips : You can use emoji and drag and drop pictures and gif to comments and introduce requests.
Step 5: Merge your pull requests
in the final step, it's time to combine your changes-put your readme-edits
Branch merge to master
the branch.
- Click the Green Merge Pull Requests button to merge the changes into the
master
.
- Click Confirm Merge .
- continue to delete the branch because its changes have been merged, in purple box of the Delete Branch button.
Congratulations on your first revision success!
Python3-the most basic operations on GitHub