Q:

Cannot push local repository to GitHub (returning error 403)

I am trying to push a local Xcode project to GitHub but am getting the following error:

git push -u origin master
remote: Weak credentials. Please Update your password to continue using GitHub.
remote: See https://help.github.com/articles/creating-a-strong-password/.
fatal: unable to access 'https://github.com/josiah-brown/Test1.git/': The requested URL returned error: 403

I have already tried to change the url to ssh instead of https but then I got this error:

Test $ git push -u origin master 
Warning: Permanently added the RSA host key for IP address ' 140.82.113.3' to the list of known hosts.
git@github. com: permission denied (publickey)    
fatal: Could not read from remote repository.
Please make sure you have the correct access rights 
and the repository exists.

I have already changed my password on GitHub to make sure that it does not violate the strong password requirements and this did not fix the issue.
Anyone able to help?

A:

Make sure, with the HTTPS URL, to enter:

the right username josiah-brown
the right password (or token, if you have 2FA activated for your account). Make sure to update your GitHub password first, because your current one is too weak.

Note: I do not see any repository in your GitHub page profile, so maybe Test1 is a private repo.
If not, create it first on GitHub.

I was never prompted to enter the password when pushing to GitHub. Also the repository is now public. 

That is typical of:

an HTTP URL
with credentials cached: check with git config credential.helper

If the password cached is too weak, you need to remove it from the cache.
Then, on the next push, you will be asked for your username/password.
Again, change your password first (the current one is too weak).

