我創建了一個專案,我想將它發送到 heroku,但我的 URL 有問題,所以我想洗掉 remote.origin.url=http://exp 并將其替換為 remote.heroku.url=http://exp . 我可以在 git config 中添加新的遠程,但我不能洗掉 remote.origin 或更改 URL。
每次終端說“錯誤:沒有這樣的遠程:'origin'”但我在輸入 git config --list 時看到它存在。
已經嘗試:
- git遠程洗掉原點
- git 遠程設定 URL 來源 http://exp
- 重新啟動計算機
當我輸入 git config --list --show-origin 時,結果:
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/*
你能告訴我如何從 git config 中洗掉 remote.origin 嗎?
uj5u.com熱心網友回復:
博士的這個答案解決了我的問題。
您在全域 .gitconfig 中有 remote.origin.url。從那里洗掉它 - 它必須在本地。然后 cd repo 并使用 git remote add origin https://git.heroku.com/graphql-flutter-cours.git在本地添加它。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/469408.html
