Getting started with GitHub
Beginner

Getting started with GitHub

In this codelab you'll create a GitHub account, install Git on your computer, and set up the GitHub CLI — everything you need to start collaborating on code.

What you'll use

  • Git A version control system that tracks changes to your code so you can collaborate and roll back mistakes. Learn more
  • GitHub A platform where developers store, share, and work on code together. Learn more
  • GitHub CLI A command-line tool that lets you create repos, open pull requests, and manage issues without leaving your terminal. Learn more
20–30 min

1Create a GitHub account

Let's create your GitHub account using Google for a quick and easy setup.

  1. Go to github.com
  2. Click "Sign up" in the top-right corner.
  3. Click "Continue with Google" and sign in with your Google account.
  4. Choose a username — this will be your public identity on GitHub.
  5. Complete the verification steps and your account is ready.

💡 Tip: We recommend signing up with Google — it's the fastest way and you won't need to remember another password.

2Install Git

You'll need Git installed locally to work with repositories.

  1. Download the installer from git-scm.com/download/win
  2. Run the installer — the default options work fine for most users.
  3. Open a new Command Prompt or PowerShell window when done.

Using Windows? See Pro Tip #1 to set up Git Bash as your default IDE terminal.

Verify the installation:

Terminal
git --version

You should see a version number like git version 2.x.x.

Configure your identity:

Terminal
git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"

⚠️ Important: Use the same email address you used for your GitHub account so your commits are properly linked to your profile.

3Install the GitHub CLI

Let's install the GitHub CLI so you can work with GitHub right from your terminal.

Install using winget (recommended):

Terminal
winget install --id GitHub.cli

Using Windows? See Pro Tip #1 to set up Git Bash as your default IDE terminal.

If you don't have winget, you can download the installer instead.

Download from cli.github.com

Verify the installation:

Terminal
gh --version

4Authenticate with GitHub

Now let's connect the GitHub CLI to your account:

Terminal
gh auth login

Follow the interactive prompts:

  1. Select "GitHub.com" as the account.
  2. Choose "HTTPS" as the preferred protocol.
  3. Select "Login with a web browser" when asked how to authenticate.
  4. Copy the one-time code, press Enter, and paste it in the browser window that opens.

Confirm you're logged in:

Terminal
gh auth status

You should see your GitHub username and that the token is valid.

5Create your first repository

Let's put everything together by creating a repository, adding a file, and pushing it to GitHub.

Create a new folder and navigate into it:

Terminal
mkdir my-first-repo
cd my-first-repo

Initialize it as a Git repository:

Terminal
git init

Create a simple README file:

Terminal
echo "# My First Repo" > README.md

Stage the file and make your first commit:

Terminal
git add README.md
git commit -m "Initial commit"

Create the repository on GitHub and push:

Terminal
gh repo create my-first-repo --public --source=. --push

This command does three things: creates the repository on GitHub, adds it as a remote, and pushes your code — all in one step.

Open your browser and go to:

Terminal
https://github.com/YOUR-USERNAME/my-first-repo

Replace YOUR-USERNAME with your actual GitHub username.

You should see your repository with the README file. That's your first project on GitHub!

6What's next

Now that you have GitHub set up, here are some great next steps:

🌐 Host a static website

Turn any GitHub repo into a free website — Use GitHub Pages to host a static website

Deploy web apps

Ship full-stack apps with automatic deployments — Deploy web apps with Vercel

📦 Install Node.js & npm

Set up the JavaScript runtime for building apps — Getting started with Node.js & npm

🤖 Try an AI-powered IDE

Pair-program with AI using Google Antigravity — Getting started with Google Antigravity

📖 Lesson: Learn how websites work end-to-end in our Create your own website lesson.

🎉

You're all set!

You now have a GitHub account, Git installed, the GitHub CLI authenticated, and your first repository live on GitHub. You're ready to start building!

Back to codelabs

How was this codelab?

Let us know what you thought — suggestions, issues, or anything else.

Getting started with GitHub