From d988a3ab1000fc70d6f4d90b28d26869d9ea1777 Mon Sep 17 00:00:00 2001 From: retiform Date: Wed, 17 Oct 2018 13:42:42 -0400 Subject: [PATCH] add instructions for what to do if you add the wrong remote --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index b83da7f..4495054 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ For clarity's sake all examples in this document use a customized bash prompt in - [Repositories](#repositories) - [I want to start a local repository](#i-want-to-start-a-local-repository) - [I want to clone a remote repository](#i-want-to-clone-a-remote-repository) + - [I set the wrong remote repository.](#i-set-the-wrong-remote-repository) - [Editing Commits](#editing-commits) - [What did I just commit?](#what-did-i-just-commit) - [I wrote the wrong thing in a commit message](#i-wrote-the-wrong-thing-in-a-commit-message) @@ -145,6 +146,21 @@ To clone it into a folder with a different name than the default repository name $ git clone [url] name-of-new-folder ``` +### I set the wrong remote repository. + +There are a few possible problems here: + + +If you cloned the wrong respistory simply delete the directory created after running git clone and clone the correct repository + + +If you set the wrong repository as the origin of an existing local repository, change the url of your origin by running + +```sh +$ git remote set-url origin [url of the actual repo] +``` +For more see [this SO top](https://stackoverflow.com/questions/2432764/how-to-change-the-uri-url-for-a-remote-git-repository#2432799) + ## Editing Commits