
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 →
1Create a GitHub account
Let's create your GitHub account using Google for a quick and easy setup.
- Go to github.com
- Click "Sign up" in the top-right corner.
- Click "Continue with Google" and sign in with your Google account.
- Choose a username — this will be your public identity on GitHub.
- 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.
- Download the installer from git-scm.com/download/win
- Run the installer — the default options work fine for most users.
- 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:
git --versionYou should see a version number like git version 2.x.x.
Configure your identity:
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):
winget install --id GitHub.cliUsing 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:
gh --version4Authenticate with GitHub
Now let's connect the GitHub CLI to your account:
gh auth loginFollow the interactive prompts:
- Select "GitHub.com" as the account.
- Choose "HTTPS" as the preferred protocol.
- Select "Login with a web browser" when asked how to authenticate.
- Copy the one-time code, press Enter, and paste it in the browser window that opens.
Confirm you're logged in:
gh auth statusYou 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:
mkdir my-first-repo
cd my-first-repoInitialize it as a Git repository:
git initCreate a simple README file:
echo "# My First Repo" > README.mdStage the file and make your first commit:
git add README.md
git commit -m "Initial commit"Create the repository on GitHub and push:
gh repo create my-first-repo --public --source=. --pushThis 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:
https://github.com/YOUR-USERNAME/my-first-repoReplace 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