When trying to remove the default url in my repo, I issued the command:
git remote set-url --delete origin https://github.com/dpressey/barberapp.git
I received the error as shown above in the title. How do I delete this "https" url and then add an "ssh" url, so that i can push to it?
The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.
Note: The “fatal: 'origin' does not appear to be a git repository” error occurs when you try to push code to a remote Git repository without telling Git the exact location of the remote repository. To solve this error, use the git remote add command to add a remote to your project.
From Git's remote
documentation, --delete
should work with:
git remote set-url --push --delete origin [https://github.com/dpressey/barberapp.git]
because the syntax is --delete <name> <url>
where <url>
is a regular expression.
As a side note, it should be pointed that there is also git remote rm <name>
that deletes every remotes matching the given name, whatever the URLs.
If you want to reset the origin to a different url, you can directly override it:
$ git remote set-url origin ssh://yournewurl
and verify it using:
$ git remote -v
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With