KDecker KDecker - 3 months ago 12
Bash Question

Windows Git Bash shell cannot find commands?

I have recently been screwing around with Windows Git Bash shell to try and force its

~
to not be my mapped network drive
Z:
and instead something more logical and useful. To do so I tried to edit
C:\Program Files (x86)\Git\etc\profile
, upon saving my changes and restarting it seems that GitBash now cannot find most all commands.

enter image description here

What happened and how do I fix this?

I'd also like to note that I could not edit
profile
with Notepad++ or any other text editor, each complained that the file was already opened elsewhere on the computer when trying to save the changes. To edit the file I had to use
vim
within Git Bash. Also once I saved these inserts (
HOME="C:\Users\..\__GitBash\
) I could not view the changes with Notepad++, the file modified date didn't even change (though oddly enough it seems that
~
is now
C:\Users\...\Documents
; BUT NOT
C:\Users\...\Documents\__GitBash\
)... Also note I do not have administrator privileges on this computer.

Answer

Try this, if your $PATH does not include a reference to git.exe:

First, echo to see if it does contain a git.exe reference:

echo "$PATH"

If not, add the path using this command:

PATH="$PATH;C:\Program Files(x86)\Git\bin"

Make sure that the path correctly addresses an existing file on your system, too.