如何在 Heroku 上更改应用程序的 git url
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15054699/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change git url for app on Heroku
提问by lavapj
When I run "git remote -v" from Terminal I get the following:
当我从终端运行“git remote -v”时,我得到以下信息:
heroku [email protected]:obscure-taiga-9581.git (fetch)
heroku [email protected]:obscure-taiga-9581.git (push)
origin http://coastguard-quiz.herokuapp.com/ (fetch)
origin http://coastguard-quiz.herokuapp.com/ (push)
I want to replace the "[email protected]:obscure-taiga-9581.git" part. How do I do that?
我想替换“[email protected]:obscure-taiga-9581.git”部分。我怎么做?
回答by Wing Lian
I assume what you want to do is push to coastguard-quiz repo which is on heroku, so that when you git push heroku
it updates the caostguard-quiz.herokuapp.com.
我假设您想要做的是推送到 heroku 上git push heroku
的 Coastguard -quiz 存储库,以便当您更新 caostguard-quiz.herokuapp.com 时。
git remote rm heroku
git remote add heroku [email protected]:coastguard-quiz.git
回答by pdoherty926
I'm not sure how it'll affect Heroku, but you can change the path in .git/config
我不确定它会如何影响 Heroku,但您可以更改 .git/config 中的路径
回答by pdoherty926
- Remove
"[email protected]:obscure-taiga-9581.git"
- 消除
"[email protected]:obscure-taiga-9581.git"
git remote rm heroku
git 远程 rm heroku
then add new remote repository
然后添加新的远程存储库
git remote add heroku [email protected]:your_nick/name_of_repo.git # this is good to copy paste from your github account