git 从网站重命名了 heroku 应用程序,现在找不到了

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7615807/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 11:58:22  来源:igfitidea点击:

renamed heroku app from website, now it's not found

githeroku

提问by Connor

After renaming my heroku app from the heroku website, whenever I cd to it's directory in a terminal and run any heroku command, I get App not found. Does anybody know of a way to remedy this?

从 heroku 网站重命名我的 heroku 应用程序后,每当我在终端中 cd 到它的目录并运行任何 heroku 命令时,我都会得到App not found. 有人知道解决这个问题的方法吗?

回答by James Ward

Try to update the git remote for the app:

尝试更新应用程序的 git remote:

git remote rm heroku
git remote add heroku [email protected]:yourappname.git

回答by Hishalv

The Answer by James Ward is also correct, alternatively try doing this:

James Ward 的答案也是正确的,或者尝试这样做:

1). open a terminal

1)。打开终端

2). Go to your_app_directory/.git/config

2)。转到 your_app_directory/.git/config

3). Once you open the config file then edit as follows:

3)。打开配置文件后,进行如下编辑:

Change

改变

url = [email protected]:old_app_name.git

to

url = [email protected]:new_app_name.git

Obviously substituting your apps old name to its new name. Hope it helps Also checkout this link renaming from cli - heroku

显然将您的应用程序旧名称替换为新名称。希望它有帮助还签出此链接从 cli - heroku 重命名

回答by Juampi

git remote rm heroku
heroku git:remote -a newname

回答by reergymerej

From the Heroku docs...

Heroku 文档...

If you rename from the website ... [your app] will need to be updated manually:

如果您从网站重命名... [您的应用] 将需要手动更新:

git remote rm heroku
heroku git:remote -a newname

回答by Moh Hasbi Assidiqi

There is another way, you can fix it by renaming the app to the original name via web.

还有另一种方法,您可以通过网络将应用程序重命名为原始名称来修复它。

To find out the old name use heroku command line:

要找出旧名称,请使用 heroku 命令行:

> heroku rename newname

which will spit out the old name. Use the old name to rename the app via web. You can check if renaming success by running

这将吐出旧名称。使用旧名称通过网络重命名应用程序。您可以通过运行来检查重命名是否成功

> heroku info

Once done you can rename to the preferred name by using

完成后,您可以使用重命名为首选名称

> heroku rename preferredname

回答by Darryl Mendonez

James Ward's solution didn't work for me. I had to enter my git url in a different format:

James Ward 的解决方案对我不起作用。我必须以不同的格式输入我的 git url:

git remote rm heroku
git remote add heroku https://git.heroku.com/appname.git