Get started using GitHub in less than an hour.
People use GitHub to build some of the most advanced technologies in the world. Whether you’re visualizing data or building a new game, there’s a whole community and set of tools on GitHub that can help you do it even better. GitHub Skills’ “Introduction to GitHub” course guides you through everything you need to start contributing in less than an hour.
- Who is this for: New developers, new GitHub users, and students.
- What you'll learn: We'll introduce repositories, branches, commits, and pull requests.
- Prerequisites: None. This course is a great introduction for your first day on GitHub.
- How long: This course is four steps long and takes less than one hour to complete.
- Above these instructions, right-click Use this template and open the link in a new tab.

- In the new tab, follow the prompts to create a new repository.
- For owner, choose your personal account or an organization to host the repository.
- We recommend creating a public repository—private repositories will use Actions minutes.

- After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README.
Welcome to "Introduction to GitHub"! 👋
What is GitHub?: GitHub is a collaboration platform that uses Git for versioning. GitHub is a popular place to share and contribute to open-source software.
📺 Video: What is GitHub?
What is a repository?: A repository is a project containing files and folders. A repository tracks versions of files and folders.
📺 Video: Exploring a repository
What is a branch?: A branch is a parallel version of your repository. By default, your repository has one branch named main and it is considered to be the definitive branch. You can create additional branches off of main in your repository. You can use branches to have different versions of a project at one time.
On additional branches, you can make edits without impacting the main version. Branches allow you to separate your work from the main branch. In other words, everyone's work is safe while you contribute.
📺 Video: Branches
When working on a project, branches are extremely important for maintaining your own version of history. You will almost never work on release or develop directly.
- Open up your terminal, and clone this repository.
gh repo clone {name of repo} - Then go into your newly created directory
cd {name of repo} - Create a new branch! But first, there are a few things to learn about what to actually name it.
- The name of your branch should be either
fix/orfeaturefollowed by a name that describes what your branch will do. - On
EGRCspecifcally, you will be using kebab case.
- The name of your branch should be either
git switch -c feature/add-readmeswitchswitches to a different branch-cflag creates a new branch
- Move on to Step 2!
You created a branch! 🎉
Creating a branch allows you to edit to your project without changing the main branch. Now that you have a branch, it’s time to create a file and make your first commit!
What is a commit?: A commit is a set of changes to the files and folders in your project. A commit exists in a branch.
The following steps will guide you through the process of committing a change on Git. Committing a change requires first adding a new file to your new branch.
- On your new branch create a file using your favorite text editor! It can really be anything, but lets make a
README.mdfile.
vim README.md - Make some changes to your file.
# Hello, World!- Save your file and go back to the command line. If you do
git status, it should say that your files areNot StagedSo we need to track them! Just dogit add README.md. Lets quickly define some terms that you may see when doinggit status.- Untracked: an untracked file is a file that git is not watching for changes on.
- Modifed: a modifed file is a file that is being tracked, but the changes are not yet staged.
- Staged: a staged file is one that is about to be commited.
- Commited: once a file is commited, it is added to the project's history.
- Time to commit your changes! Do
git commitand you will be brought to a text editor. - Now comes the most important part, the commit message. There is a ton of documentation on what makes a good commit message, like here, but we will quickly go over some key ideas.
- A good commit message documents not only what has been changed but the why and how.
- Keep the first line to say what your commit does using the imperative mood. Like
add READMEorHandle errors in bar function. The first line should be < 50 characters long. - The next lines should describe why you made this commit and a bit of explanation on that change. This can be a few senteces to a few paragraphs long. Make sure to keep your lines < 72 and to use lines between paragraphs. We do not really need to put much, if anything, for this commit but it is helpful to know.
- Save your changes and exit the commit dialog.
- Push your changes to your remote branch.
git push origin {your-branch-name}. - Move on to Step 3! Note: Like before, you can wait about 20 seconds, then refresh this page (the one you're following instructions from) and GitHub Actions will automatically close this step and open the next one.
Nice work making that commit ✨
Now that you’ve created a commit, it’s time to share your proposed change through a pull request!
What is a pull request?: Collaboration happens on a pull request. The pull request shows the changes in your branch to other people. This pull request is going to keep the changes you just made on your branch and propose applying them to the main branch.
📺 Video: Introduction to pull requests
There are a few ways to go about creating a pull request, but we will be using GitHub CLi. Like your commit, carefully creating a title and body is an important part of creating a pr. Since this is a very small tutorial, we will keep it simple here.
- In your terminal, do
gh pr create. - You should be prompted to create a title
? Title. Write down a descriptive title and hitenter. - Then you will prompted to create a body description
? Body. Write down a description of your pr. If it addresses a specific issue, make sure to mention that in your description. Something likeCloses #10. Hitenter. - You should get a link to your newly created pr!
- Move on to Step 4!
Note: Like before, you can wait about 20 seconds, then refresh this page (the one you're following instructions from) and GitHub Actions will automatically close this step and open the next one. As a perk, you may see evidence of GitHub Actions running on the tab with the pull request opened! The image below shows a line you might see on your pull request after the Action finishes running.

Nicely done friend! 😎
You successfully created a pull request. You can now merge your pull request.
What is a merge: A merge adds the changes in your pull request and branch into the main branch.
📺 Video: Understanding the GitHub flow
As noted in the previous step, you may have seen evidence of an action running which automatically progresses your instructions to the next step. You'll have to wait for it to finish before you can merge your pull request. It will be ready when the merge pull request button is green.
- Click Merge pull request.
- Click Confirm merge.
- Once your branch has been merged, you don't need it anymore. To delete this branch, click Delete branch.

- Check out the Finish step to see what you can learn next!
Note: Like before, you can wait about 20 seconds, then refresh this page (the one you're following instructions from) and GitHub Actions will automatically close this step and open the next one.
Congratulations friend, you've completed this course and joined the world of developers!
Here's a recap of your accomplishments:
- You learned about GitHub, repositories, branches, commits, and pull requests.
- You created a branch, a commit, and a pull request.
- You merged a pull request.
- You made your first contribution! 🎉
If you'd like to make a profile README, use the simplified instructions below or follow the instructions in the Managing your profile README article.
- Make a new public repository with a name that matches your GitHub username.
- Create a file named
README.mdin it's root. The "root" means not inside any folder in your repository. - Edit the contents of the
README.mdfile. - If you created a new branch for your file, open and merge a pull request on your branch.
- Lastly, we'd love to hear what you thought of this course in our discussion board.
Check out these resources to learn more or get involved:
- Are you a student? Check out the Student Developer Pack.
- Take another GitHub Skills course.
- Read the GitHub Getting Started docs.
- To find projects to contribute to, check out GitHub Explore.
Get help: Post in our discussion board • Review the GitHub status page
© 2022 GitHub • Code of Conduct • CC-BY-4.0 License
