DEV Community

Cover image for “[GitHub] Deprecation Notice” for Password to Git Resolved
Albir Tarsha
Albir Tarsha

Posted on

“[GitHub] Deprecation Notice” for Password to Git Resolved

One Small Step For GitHub Security Requires One Giant Leap For Casual Git Users

“using a password to Git is deprecated”

Distant Early Warning

By now you have probably received an email similar to this and disregarded it as August 13, 2021 was quite far away. Now being April I felt that I had sufficiently procrastinated and it was time for a spring cleaning.

Hi @my_username,

You recently used a password to access the repository at MyTeam/ProjectRepo with git using git/2.25.1.

Basic authentication using a password to Git is deprecated and will soon no longer work. Visit for more information around suggested workarounds and removal dates.

The GitHub Team

Thus began my quest to fix this warning before being locked out in August….

To keep this short I will not talk about the travails chronologizing how I uncovered this fix. Instead I will simply elaborate upon the order that I used the referenced documents.

Where Is My Password Information Being Kept?

I set up git and my GitHub years ago and forgot how I did it. Googling “git config” gave me the command git config --list which helped me establish that I did use macOS Keychain.

$ git config --list
[etc ...]
Enter fullscreen mode Exit fullscreen mode

Next I removed the github entry as described here in this document.

$ git credential-osxkeychain erase
[Press Return again leaving a blank line]
Enter fullscreen mode Exit fullscreen mode

The command git push will now ask for Username and Password demonstrating that the password is cleared out.

Great, Now How Do I Git Back In?

I used a tip from airtower-luna:

“The smallest change from using your password would be to create a personal access token (PAT) with the repo scope and use that instead of your password when pushing. Using a password manager to keep the token is a good idea.”

And I followed the instructions contained below to create a personal access token, checking the box for the scope “repo” at step 7. Immediately I saved a copy of the token. (Copy-paste.) I tested my token using git push and passed the token for the password.

How Do I Stash That Token?

Lol. The token is already saved. The token was stored for future use automatically when I tested git push and passed the token. So executing git push again gave no password request.

$ git push
Username for '': my_username
Password for '': 
Everything up-to-date
$ git push
Everything up-to-date
Enter fullscreen mode Exit fullscreen mode

More About The Requirements

For more about the requirements from GitHub you can refer to the GitHub Blog.

Now, back to work.

Top comments (0)