Git push problem

I set up the two-factor authentication today since Github now required a personal access token for git operations. But, I’m still unable to push and seeing this message and don’t know why. What should I do?

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see Token authentication requirements for Git operations | The GitHub Blog for more information.
fatal: unable to access ‘GitHub - JIB3377/fed-challenge: FED Design Challenge’: The requested URL returned error: 403

I solve this with SSHkeys

Look this from superuser.com (I use the first approach).

In ~/.ssh/config , add:

Host github.com
 HostName github.com
 IdentityFile ~/.ssh/Your_RSA_For_Github

If the config file is new, you might need to do chmod 600 ~/.ssh/config

And look this from GitHub Docs, I follow all steps, the push request me the passphrase of the ssh-key, and push success.

1 Like

Thank you. It worked!

1 Like

I’ve never used a private Git repo until recently. I’m having trouble with gaining access to my private repo from my local machine. I’m given this message when I try: remote: Repository not found. fatal: repository 'https://github.com/[Host]/[Repo].git/' not found.

I’ve already initialized my local repository. Now I just need to connect it to my private remote repository. I’d like to use my personal access token instead of ssh.

Here are the commands I’m using on Windows:

git remote set-url origin https://JeffMII:[Token]@github.com/[Host]/[Repo].git
git add .
git commit -m "Commit" ---> Output: On branch master nothing to commit, working tree clean
git push --set-upstream origin master ---> Output: Gives me the error