Background
Sometimes last week received an email from GitHub.
Basic Authentication using a password to Git is deprecated
Image
Textual
Hi @DanielAdeniji, You recently used a password to access the repository at DanielAdeniji/hello with git using git/2.29.2.windows.2. Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates. Thanks, The GitHub Team
Explanation
Here is what is conveyed via email:-
- Repository Name
- DanielAdeniji/hello
- Git Client Version
- git/2.29.2.windows.2.
- Git Client Version Number
- 2.29.2
- OS Version
- Windows
- Git Client Version Number
- git/2.29.2.windows.2.
- Notice
- Basic authentication using a password to Git is deprecated
Goal
Our goal in this post is to determine if indeed the repository is currently configured for HTTP.
If it is configured for HTTP, then we are using password authentication.
And, in that case, we want to evaluate and explore the steps that we should undertake to have the particular repository use SSH keys.
TroubleShooting
Outline
- Git Commands
- Git Remote
Tasks
Git Commands
Git Remote
Syntax
git remote -v
Sample
git remote -v
Output
Output – Image
Output – Text
>git remote -v origin https://github.com/DanielAdeniji/hello (fetch) origin https://github.com/DanielAdeniji/hello (push)
Explanation
- https://github.com
- git
- Using HTTPS
- git
- DanielAdeniji
- Organization
- Repository
- hello
Remediation
Because git remote returns a URL, we need to change from HTTP to ssh.
Outline
- Git Commands
- Git Remote
- Git Remote set-url
- Git Remote -v
- Git Push
- Git Push
- Git Remote
Tasks
Git Commands
Git Remote
Git Remote Set-URL
Syntax
git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
Sample
git remote set-url origin git@github.com:labOrg/dbWork.git
Git Remote -v
Syntax
git remote -v
Sample
git remote -v
Output – Text
>git remote -v origin git@github.com:labOrg/hello.git (fetch) origin git@github.com:labOrg/hello.git (push)
Explanation
- git@github.com
- git
- Using ssh keys
- git
- DanielAdeniji
- Organization
- Repository
- hello.git
Git Push
Syntax
git push
Sample
git push
References
- Github.com
- Using Git > Managing remote repositories > Changing a remote’s URL
Link
- Using Git > Managing remote repositories > Changing a remote’s URL