Hello World Hello World: What Is Github?
Hello World Hello World: What Is Github?
com/activities/hello-world/
Hello World
10 minute read
Intro
The Hello World project is a time-honored tradition in
What is GitHub?
computer programming. It is a simple exercise that gets
Create a Repository
you started when learning something new. Lets get
Create a Branch
started with GitHub!
Make a Commit
Youll learn how to: Open a Pull Request
What is GitHub?
GitHub is a code hosting platform for version control
1 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
and collaboration. It lets you and others work together on projects from
anywhere.
This tutorial teaches you GitHub essentials like repositories, branches, commits,
and pull requests. Youll create your own Hello World repository and learn
GitHubs pull request workflow, a popular way to create and review code.
No coding necessary
To complete this tutorial, you need a GitHub.com account and Internet access.
You dont need to know how to code, use the command line, or install Git (the
version control software GitHub is built on).
Tip: Open this guide in a separate browser window (or tab) so you can see it
while you complete the steps in the tutorial.
2 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
1. In the upper right corner, next to your username, click and then click New
repository.
2. Name your repository hello-world .
3. Write a short description.
4. Select Initialize this repository with a README.
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 .
3 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
When you create a branch off the master branch, youre 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.
story.txt
story-joe-edit.txt
story-joe-edit-reviewed.txt
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 .
4 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
Now you have two branches, master and readme-edits . They look
exactly the same, but not for long! Next well add our changes to the new branch.
On GitHub, saved changes are called commits. Each commit has an associated
5 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
These changes will be made to just the README file on your readme-edits
branch, so now this branch contains content thats different from master .
6 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
Pull Requests are the heart of collaboration on GitHub. When you open a pull
request, youre 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 GitHubs @mention system in your pull request message, you can ask
for feedback from specific people or teams, whether theyre down the hall or 10
time zones away.
You can even open pull requests in your own repository and merge them
yourself. Its a great way to learn the GitHub Flow before working on larger
projects.
Step
7 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
Step
8 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
Step
9 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
Step
When youre
satisfied that
these are the
changes you want
to submit, click the
big green Create
Pull Request
button.
10 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
Step
When youre 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.
11 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
1. Click the green Merge pull request button to merge the changes into
master .
2. Click Confirm merge.
3. 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, youve learned to create a project and make a pull
request on GitHub!
12 of 13 03/08/2016 08:24 AM
Hello World GitHub Guides https://guides.github.com/activities/hello-world/
Take a look at your GitHub profile and youll see your new contribution squares!
If you want 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 and YouTube Channel for more GitHub
how-tos.
GitHub is the best way to build and ship software.
Powerful collaboration, code review, and code management for open source and private
projects.
13 of 13 03/08/2016 08:24 AM