Bug/Git

[Git Bug] git remote origin already exists bug

brightlightkim 2022. 3. 23. 12:06

I was making the git push for the other's repository to my private one. And then I got this error. 

 

The simple solution was deleting the upstream and main and just publish it as a new one through the Visual Studio Code. 

 

Viewing and Deleting Codes look like this.

$ git remote -v

origin  https://github.com/BYUCS260/learning-mongo.git (fetch)
origin  https://github.com/BYUCS260/learning-mongo.git (push)
upstream        https://github.com/BYU-CS-260-Winter-2019/learning-mongo.git (fetch)
upstream        https://github.com/BYU-CS-260-Winter-2019/learning-mongo.git (push)

$ git remote remove upstream

$ git remote remove origin

$ git remote -v
//nothing

//Then just publish the page to GitHub through using VS Code

 

https://www.cloudbees.com/blog/remote-origin-already-exists-error