xxxxxxxxxx
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Solution:
// Run your ssh agent and add the correct key
eval ''$(ssh-agent -s)'' && ssh-add ~/.ssh/id_rsa_work_user1
xxxxxxxxxx
#Given that:
#your username= a-elnawawy
#your repo link = https://github.com/ElNawawy-org/NextTemplate-JS.git
#Then do:
git remote rm origin
git remote add origin https://a-elnawawy@github.com/ElNawawy-org/NextTemplate-JS.git
#you will get a prompt to write your password, don't write it but your token
git not found
xxxxxxxxxx
git remote set-url origin https://github.com/MyRepo/project.git
xxxxxxxxxx
git remote set-url origin https://github.com/MyRepo/project.git
xxxxxxxxxx
Add "Personal Access Token"
Since since 2021 Github supports PAT rather than name/password
(read here how to create and use one) so we just add it into the remote
origin: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
On Windows
Visit .git folder and open config file for editing. Eg. vim config.
Change your URL from
https://github.com/<username>/<repo_name>.git
to
https://[personal-access-token]@github.com/<username>/<repo_name>.git
Where [personal-access-token] is the PAT hash you've created at github.
Save the config file and now the push should work.
Shortcut:
git remote remove origin
git remote add origin https://[personal-access-token]@github.com/username/repo_name.git