github.com authentication token for git oppressions

github.com new security enhancements requires users to use a personal access when accessing repositories. Following are steps to configure your developer environment.

For existing private repositories using password authentication it will give the following error

remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.

go to https://github.com and navigate to: profile icon -> settings

navigate to: developer settings

navigate to: personal access tokens -> Generate new token

Generate a new token. You have to give access to repo scopes. Be mindful about the Expiration. when the token expires, you will need to generate a new token. Click Generate Token

Copy the newly generated token, you will be able to see the token only once, so keep it secured

To clone a repository you can use the token you generated

git clone https://<token>@github.com/user/repo.git

If you have cloned a repository before, you can change the remote

Go to you project directory and edit <project dir>/.git/config file and add the token to your [remote “origin”] url

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://<token>@github.com/user/repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[pull]
ff = only
[branch "3.0"]
remote = origin
merge = refs/heads/3.0

That should do it, you are good to go