1

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

command and error in terminal

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:

error after I changed url to ssh

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?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
JBrown
  • 825
  • 6
  • 22
  • 1
    Welcome to Stack Overflow :) Check if you can successfully establish a connection to GitHub by running `ssh -T git@github.com`. Also, run `ssh-add -K ~/.ssh/id_rsa` (or replace it with the name of your private key) to add the SSH key to your SSH agent and try again. – Nimesh Neema Apr 01 '20 at 04:07
  • 1
    @phd Sorry, I did not fixed the question when I answered before. I have done so now ([Google Lens](https://lens.google.com/) comes in handy) – VonC Apr 01 '20 at 11:17
  • @VonC Thanks, I retracted my downvote. Nice trick with the Lens! – phd Apr 01 '20 at 11:17
  • @VonC Can you please share how did you leverage Google Lens? Did it help in converting image to text? Thanks. – Nimesh Neema Apr 01 '20 at 11:18
  • 1
    @phd I use it all the time, it works like magic! – VonC Apr 01 '20 at 11:19
  • 1
    @NimeshNeema I simply use my phone, open Lens, select text and copy it to a google doc. From my computer, I open that same Google doc (automatically synchronized by Google) and... I copy the text from that Google doc to your question. – VonC Apr 01 '20 at 11:20
  • @VonC Sorry, but that reminded me of [Web 0.1](https://thedailywtf.com/articles/Web_0_0x2e_1). I do believe that's a useful tool, but the idea of pointing a phone at a screen just made me chuckle... What if I use SO on my phone, should I borrow another phone to point at its screen? – filbranden Apr 20 '20 at 14:38
  • 1
    @filbranden Google Lens can also work with a screenshot (https://www.androidauthority.com/google-lens-screenshot-1029772/): capture one on your phone, and apply Google Lens on it ;) – VonC Apr 20 '20 at 16:41

1 Answers1

1

Make sure, with the HTTPS URL, to enter:

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).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • at what point do I enter the password? I was never prompted to enter the password when pushing to GitHub. Also the repository is now public. – JBrown Apr 01 '20 at 14:26
  • @JBrown I have edited the answer to address your comment. – VonC Apr 01 '20 at 14:52
  • thank you for the help! I figured out that terminal was using the credentials from an old GitHub account I had created years back and forgotten about. I was able to update the credentials and it worked – JBrown Apr 01 '20 at 16:10