After having enabled two-factor authentication I get the following error when attempting git clone, git fetch, etc:
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/smartsendio/pickup-map.git/'
After having enabled two-factor authentication I get the following error when attempting git clone, git fetch, etc:
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/smartsendio/pickup-map.git/'
After getting your access token you'll need to run one of the following commands. Then when you run your next 'git push' it'll ask you for your username and password, which is your access token.
MAC git config --global credential.helper osxkeychain
WINDOWS git config --global credential.helper wincred
One solution is to use a personal access token, as already described by @surendra; another solution is to use a password-protected SSH key:
Follow the instructions here:
...but the essential point I want to make about authenticating with ssh is about the git config file, .git/config (inside your repo). You may see a line similar to the following:
[remote "origin"]
url = https://github.com/smartsendio/pickup-map.git
fetch = +refs/heads/*:refs/remotes/origin/*
Note the url line above... it must be changed to:
url = git@github.com:smartsendio/pickup-map.git
...you can copy/paste the value from your GitHub repo's Code button: