With GitHub’s recent changes, passwords are no longer allowed for authentication when performing actions like check-in or check-out. Here’s how you can update your authentication method to use a personal access token instead of a password on macOS.
Table of Contents
Step 1: Generate a Personal Access Token (PAT)
- Go to your GitHub account and navigate to Settings.
- Under Developer settings, select Personal access tokens.
- Click on Generate new token.
- Select the scopes or permissions you need for your token, such as repo access.
- Click Generate token and copy the token somewhere safe (you won’t be able to see it again).
Step 2: Update Git Credentials on macOS
- Open Terminal.
- Use the following command to clear the old GitHub credentials:
- When prompted for your GitHub credentials during the next git push or pull, enter your username and paste your new personal access token in place of your password.
1 |
git credential-osxkeychain erase |
Step 3: Store Token in macOS Keychain
If you want to avoid entering the token repeatedly, macOS will offer to store it in your keychain after you enter it once during authentication.
That’s it! Your GitHub authentication should now be updated to use a personal access token on macOS.
I am Tuan from Vietnam. I am a programmer Freelancer at web scraping, web automation, Python scripting. I have worked for 7+ years in these fields.