GitHub: How to authenticate to GitHub using username and password

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


I was setting up a new editor and I was trying the GitHub push workflow.

I committed my changes, pressed “Push” and I got a dialog window to enter my GitHub username and password.

On GitHub I have 2FA set up, so you can’t just login using those credentials.

What I had to do was create a personal access token that’s tied to the app, with the permission needed.

So I went to the GitHub settings, located Developer Settings:

Clicked Personal access tokens:

Now add a name so you’ll remember what this token is for, set the expiration to “No expiration” and enable the repo scope. That’s the only one you need:

Save and you’ll be able to see the token.

Now enter this token as the password in the username/password dialog window.

You’re set.

Lessons in this unit:

0: Introduction
1: GitHub issues
2: Social coding
3: Pull requests
4: Project management
5: Comparing changes
6: Webhooks and integrations
7: What happens after pushing
8: Create a GitHub account
9: Using GitHub desktop
10: Using Git in VS Code
11: A developer's introduction to GitHub
12: How to set up Git and GitHub from Zero
13: ▶︎ How to authenticate to GitHub using username and password
14: How to make your first Pull Request on GitHub
15: Benefits of using Git (and GitHub) as a solo dev