0

I reviewed this answer here: Message "Support for password authentication was removed. Please use a personal access token instead."

But I still get error

PS C:\Js Projects> git push -u origin main
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/zac/FindCommonItems.git/'

I generated a classic token with all permissions and I set it in Windows 11 credential manager like that

enter image description here

In VS Code when I run

git push -u origin main

I get the same error above. What I am missing?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
zac
  • 4,495
  • 15
  • 62
  • 127
  • I get some lines if I used this: usage: git remote set-url [--push] [] or: git remote set-url --add or: git remote set-url --delete – zac Dec 31 '22 at 16:19
  • 1
    Sorry, I missed the part while pressing backspace too long time `git remote set-url origin git@github.com:zac/FindCommonItems.git` – 273K Dec 31 '22 at 16:21
  • This error when I try to push: git@github.com/zac/FindCommonItems.git' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. – zac Dec 31 '22 at 16:28

1 Answers1

-1

Worked thanks to @273K like this:

Deleted .git folder
git remote set-url origin git@github.com:zac/FindCommonItems.git
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com/zac/FindCommonItems.git
git push -u origin main

It prompt also to authenticate from browser

zac
  • 4,495
  • 15
  • 62
  • 127
  • 1
    You're calling `git remote set-url origin git@github.com:zac/FindCommonItems.git` after you deleted `.git` directory. This has no right to do anything. Didn't you get an error on this command? – Piotr Siupa Dec 31 '22 at 17:34
  • At the end you're still using https url. – Piotr Siupa Dec 31 '22 at 17:35