How to use GitHub for beginners: repos, branches and pull requests

Learn the core GitHub workflow: create a repository, make a branch, commit changes and open a pull request to merge them. It suits anyone new to version control who wants to store and share code online. You only need a free GitHub account and a web browser.

YouTube video: How To Use GitHub For Beginners

Caption availability is unknown. Check the CC control in the YouTube player.

Video length
10 min 29 s
Time to do it
20 minutes
Difficulty
Easy
Steps
8

What you need

Steps

  1. Sign in at github.com and click the plus icon in the top right, then New repository. Give it a short name and choose Public or Private.

  2. Tick Add a README file so the repo starts with a page, then click Create repository. Your new repo opens straight away.

  3. Click the branch dropdown that says main and type a new branch name, such as first-edit. Press Create branch to work without touching main.

  4. Open a file and click the pencil icon to edit it. Make a small change, scroll down and write a short message in the commit box.

  5. Click Commit changes and make sure the option to commit to your new branch is selected, not main.

  6. Click Compare and pull request. Add a title and a sentence explaining the change, then click Create pull request.

  7. Review the Files changed tab to check the edit, then click Merge pull request and Confirm merge. Delete the branch if you are done with it.

  8. To add your own files, go back to the main repo page, click Add file and Upload files, then drag files in and commit them.

Tips and common mistakes

Commit small changes often with clear messages so history stays easy to read.

Never commit passwords or API keys. Use a.gitignore file or repository secrets instead.

Work on a branch and merge through a pull request, even when you are alone, to build good habits.

Questions

Do I need to install Git to use GitHub?

No. You can create repos, edit files and merge pull requests entirely in the browser. Install Git later when you want to work from your own computer.

What is the difference between Git and GitHub?

Git is the version control tool that tracks changes on your machine. GitHub is a website that hosts Git repositories and adds collaboration features like pull requests.

Can I keep my repository private?

Yes. Choose Private when you create the repo. Only you and people you invite can see it.

The notes are drafted automatically from video details and general task knowledge. How the guide was prepared

Report a correction

More in Apps & Software

See all