Github authentication

Hello, good afternoon

I wanted to ask a question. That is because with the 2-factor authentication activated in my account I cannot copy my local repository to remote and it always sends me these two errors:

  • Fatal: remote part of refspec is not valid in
    And when I try to do git push -u origin main and enter username and password it tells me:
    -Fatal: authentication failed for

could someone help me with this

You’ll need to create a personal access token (PAT) and use that when Git asks for your password. See: Creating a personal access token - GitHub Docs