2

I have a repository which I cloned with https instead of ssh. Now everytime I change the system password, I'm required to update it in the credential manager. So I generated ssh key and added on the local as well as remote repository to establish ssh communication. The problem is it still says basic authentication failed if I try running a command, such as git fetch or git push, which require establishing a connection with the server . Seems like once we are cloning a repository with https, we're not able to change it to follow the ssh protocol. Is there a way to navigate around that?

phd
  • 82,685
  • 13
  • 120
  • 165
ABGR
  • 4,631
  • 4
  • 27
  • 49
  • Possible duplicate of [How to change the URI (URL) for a remote Git repository?](https://stackoverflow.com/questions/2432764/how-to-change-the-uri-url-for-a-remote-git-repository) – phd Oct 15 '19 at 15:44
  • https://stackoverflow.com/search?q=%5Bgit%5D+how+to+change+remote+URL – phd Oct 15 '19 at 15:44

1 Answers1

1

Change the remote URL by using git remote set-url. If HTTPS it should be something like this: git remote set-url origin https://github.com/USERNAME/REPOSITORY.git If SSH: git remote set-url origin git@github.com:USERNAME/REPOSITORY.git. More info here

ignacio
  • 1,181
  • 2
  • 15
  • 28