How to remove a git remote
In the comments of my article How to use GitHub with Android Studio 1.x, Cynthia gets the following error:
can't add remote
fatal: remote origin already exists.
during execution git remote add origin
Unfortunately, it seems that Android Studio doesn’t offer any way to modify/add/remove git remotes from your repository. However you can still remove it by following the below steps. I am using Windows 8.1 but it should work on other operating systems (for Mac/Linux just replace command line with the console or terminal).
First, navigate to the root of your project in the file system, right click the background of the directory and select Git Bash:

This will bring up the git console. In the git console type the following command:
git remote rm origin

The git remote will now be removed from the repository.




Hi there,
Even i faced the same issue and followed your advice.Well now i am able to share on github again.But it is again creating an old repository which i had deleted a while ago.If i try to share again, i again get the error
can’t add remote
fatal: remote origin already exists.
during execution git remote add github
.Bottom line is an old repository of mine keeps recreating if i try to share some other project from android studio :(.
Please help
Helped. Thanks,
I did this, Again it shows the same error
fatal: remote github already exits blah blah blah 🙁
it show the same error
worked for me! Thanks