Joy Joy - 2 months ago 17
Git Question

Delete remote repo URL which is not on .git/config?

Recently I made new project and with new repository on github.

But when I push to the new repository, it also tries to push to old repository which I never connected with the new project, Like this:

enter image description here

The old repo is in the same Github account with new repo, but it is connected to another project of mine (hence fail to push)

When I check my remote on my new project, it shows these

enter image description here

I tried to delete & change the url with set-url, or delete ... But the old url is still there

My .git/config file is

enter image description here

it doesn't have old repo url.

Pushing to new project is actually working well, but everytime I push to new one it always tries to push to old one & fails

Joy Joy
Answer Source

This also happened to my Xcode project, so after digging in again I found out my own answer. The problem was on the global file.

How can i delete git user property? This answer helped me.

git config --global --unset remote.origin.url OLD.REPO.URL

This finally solved the problem!