I created a project and I want to send it to heroku but I have a problem with the URL so I wanted remove remote.origin.url=http://exp and replace that with remote.heroku.url=http://exp. I can add new remote in git config but i can't delete remote.origin or change URL.
Everytime terminal said "error: No such remote: 'origin' " but i see it exists when i type git config --list.
already try :
- git remote remove origin
- git remote set-url origin http://exp
- restart the computer
When i type git config --list --show-origin, result:
file:/Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig credential.helper=osxkeychain
file:/Users/username/.gitconfig user.email=exp
file:/Users/username/.gitconfig user.password=exp
file:/Users/username/.gitconfig user.name=Israil exp
file:/Users/username/.gitconfig http.postbuffer=157286400
file:/Users/username/.gitconfig remote.origin.url=https://git.heroku.com/graphql-flutter-cours.git
file:.git/config core.repositoryformatversion=0
file:.git/config core.filemode=true
file:.git/config core.bare=false
file:.git/config core.logallrefupdates=true
file:.git/config core.ignorecase=true
file:.git/config core.precomposeunicode=true
file:.git/config remote.heroku.url=https://git.heroku.com/api-graphql-project.git
file:.git/config remote.heroku.fetch= refs/heads/*:refs/remotes/heroku/*
Can you tell me how to remove remote.origin from git config?
CodePudding user response:
this answer of phd resolved my problem.
You have remote.origin.url in the global .gitconfig. Remove it from there — it must be in local. Then cd repo and use git remote add origin https://git.heroku.com/graphql-flutter-cours.git to add it locally.