I have a private remote repository on GitHub that I'm trying to push to production on our AWS server (using Ubuntu). I've tried the following commands and received the following errors:
sudo git pull
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/projectrepo/projectname.git/'
sudo git remote -v
origin https://project_username:OLD_PASSWORD@github.com/projectrepo/projectname.git (fetch)
origin https://project_username:OLD_PASSWORD@github.com/projectrepo/projectname.git (push)
sudo git remote rm origin
fatal: No such remote: 'origin'
sudo git config --list
user.name=project_username
remote.origin.url=https://project_username:OLD_PASSWORD@github.com/projectrepo/projectname.git
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
sudo git remote set-url origin https://project_username:NEW_PERSONAL_TOKEN@github.com/projectrepo/projectname.git
fatal: No such remote 'origin'
Why does Git not recognize origin
and how can I correct this to update the remote.origin.url
?