将 gcloud 项目留在终端
leave gcloud project in terminal
如何通过云 cli 离开我当前的 gcloud 项目,以便恢复到我的正常终端?
15:40:08 in ~ using ☁️ default/192085439987
我只想使用
15:40:08 in ~
我已经成功地使用
在项目之间切换
gcloud config set project <project id>
但是好像什么也留不下
我想这就是我想要的
https://cloud.google.com/sdk/docs/properties#unsetting_properties
gcloud config unset disable_usage_reporting
有人可以确认吗?
当您使用 gcloud
命令时,终端保持相同的属性,如果有的话,它可能会更改您正在使用的 shell,在这种情况下 return 返回到您的previous shell 你可以直接输入 exit
这通常会让你跳出最后一个 shell.
这里有一些详细的说明,可以返回旧的 shell 或提示,具体取决于您这边的更改:
在启动 gcloud
命令之前通过键入 echo $SHELL
确定您正在使用的 shell,这将提供 shell 的名称这可能是 /bin/bash
for bash 或 /bin/zsh
for zshell.
使用完 gcloud
后,再次键入 $SHELL
并确定您现在使用的 shell 是否已更改。如果它确实发生了变化,通常使用 exit
命令,您将保留旧的 shell,如果它不起作用,您可以键入二进制文件的整个路径,然后切换到它,例如键入/bin/zsh
返回 zsh
如果prompt也改变了,你可以通过执行. ./.profile
、source ~/.zshrc
for zsh
或[=返回默认值24=] 对于 bash
如果提示从一开始就改变了(在执行 gcloud
命令之前),那么您可能必须编辑 .profile
或 .zshrc
文件以根据需要进行设置有他们,关于它的更多信息,可以找到here
如何通过云 cli 离开我当前的 gcloud 项目,以便恢复到我的正常终端?
15:40:08 in ~ using ☁️ default/192085439987
我只想使用
15:40:08 in ~
我已经成功地使用
在项目之间切换gcloud config set project <project id>
但是好像什么也留不下
我想这就是我想要的
https://cloud.google.com/sdk/docs/properties#unsetting_properties
gcloud config unset disable_usage_reporting
有人可以确认吗?
当您使用 gcloud
命令时,终端保持相同的属性,如果有的话,它可能会更改您正在使用的 shell,在这种情况下 return 返回到您的previous shell 你可以直接输入 exit
这通常会让你跳出最后一个 shell.
这里有一些详细的说明,可以返回旧的 shell 或提示,具体取决于您这边的更改:
在启动
gcloud
命令之前通过键入echo $SHELL
确定您正在使用的 shell,这将提供 shell 的名称这可能是/bin/bash
for bash 或/bin/zsh
for zshell.使用完
gcloud
后,再次键入$SHELL
并确定您现在使用的 shell 是否已更改。如果它确实发生了变化,通常使用exit
命令,您将保留旧的 shell,如果它不起作用,您可以键入二进制文件的整个路径,然后切换到它,例如键入/bin/zsh
返回zsh
如果prompt也改变了,你可以通过执行
. ./.profile
、source ~/.zshrc
forzsh
或[=返回默认值24=] 对于bash
如果提示从一开始就改变了(在执行 gcloud
命令之前),那么您可能必须编辑 .profile
或 .zshrc
文件以根据需要进行设置有他们,关于它的更多信息,可以找到here