Can I use gcloud in Git Bash for Windows?

So, I installed Git, Git Bash, Python2.7, and I just installed the Google Cloud SDK for the official guide. Using Windows 10

In cmd.exe or in the Google Cloud SDK shell, gcloud working fine.

Inside Git Bash, however (the terminal I prefer to use), gcloud returns the following output (screenshot).

enter image description here

echo $PATH in Git Bash includes the path to the Google SDK (highlighted here).

enter image description here

Am I missing something? Is there anything in $ PATH that might be against gcloud, or have I somehow distorted the path?

I appreciate any insight.


UPDATE Here is the result of env|grep PATH . I'm not sure what this tells me. Any other executable in PATH works (tramp, cond, python, etc.), but gcloud does not.

enter image description here

+5
source share
3 answers

You need to use the full file name, i.e. gcloud.sh or gcloud.cmd. For more information, see the following question:

Git Bash Doesn't See My PATH

+5
source

Create ~/.bashrc using the same line:

 alias gcloud="gcloud.cmd" 

and restart the shell session. What is it.

+3
source

Place the following in the .bashrc file, which should be located in the C: \ Users \ YourWindowsAccount folder:

 gcloud() { "gcloud.cmd" " $@ " } export -f gcloud 

Adapted from: https://askubuntu.com/a/98791

Restart Git Bash after that.

This solution is better than using aliases, as it also allows you to call gcloud from a shell script.

0
source

Source: https://habr.com/ru/post/1247881/


All Articles