The new GIT requires tokens to login and push repositories.

You might get a login error when you try to push your repository to git:

$ git push -u origin main
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/[USER]/[REPO_NAME].git/'

This is how you login using a token now:


1. Go to your git profile and select Settings > Developer settings > Personal access tokens
https://github.com/settings/tokens

* if you already have an expired token, you can click on the token and then click on "Regenerate Token" button that might look like this:

NOTE: Name Token
Expiration: One year from now

Select the following options:

[x] repo Full control of private repositories

Click Generate Token:

WRITE DOWN THE NEWLY GENERATED TOKEN:

Example_dk6uMjQOQZC4c9Ib1q009z_dkshkdkshdk

* YOU WILL NEED IT AS YOUR PASSWORD

Now you can push your repository and when prompted for password use the toke that was generated.

$ git clone https://github.com/username/repo.git
Username: your_username
Password: your_token

GIT CREDENTIAL MANAGER

To login to git use this commands:

$ git config --global user.email "[email protected]"

To check the configuration:

$ git config --global --list