I just installed Git SCM on my Windows machine. My machine had Node installed earlier. I am able to use node -v in git bash. But, Why I am able to use windows applications inside Git Bash and not in WSL Bash.
Inside WSL Bash-
hello@comp:~$ node -v
Command 'node' not found, but can be installed with:
sudo apt install nodejs
Inside Git Bash-
hello@comp MINGW64
$ node -v
v12.10.0
It is recommended to install the latest Git for Windows in order to share credentials & settings between WSL and the Windows host. Git Credential Manager is included with Git for Windows and the latest version is included in each new Git for Windows release.
Git bash is for git commands. Only commands of git work in the Git Bash. Ubuntu Bash is the complete script language for operating the system like the Windows Batch scripting but a bit advanced as we regularly use it in the Linux we focus for an easy to use the script language.
Git is a version control system that lets developers track source code changes during software development. Git Bash is an application for Microsoft Windows, allowing developers to use Git in a command-line interface.
You don't need to use Git Bash. It is just conventional, because Git was developed and designed on Linux and most Git users use Linux and using Git Bash on Windows makes it a uniform experience. You can certainly use Git on cmd; just make sure you add C:\Program Files\git\cmd to your PATH .
WSL is an a Linux like compatibility layer. You run Linux applications on top of WSL and they think they are running natively on Linux while the system calls are being translated to Windows OS system calls (WSL2 -- not yet released -- is a full Linux kernel running inside Windows). You do get to access Windows files through /mnt/c/... but that's about all you can expect in terms of Windows-Linux interoperability.
Git-bash, on the other hand, is a Windows app -- a shell running windows applications. Some of these may be compiled with a Linux compatibility library (Cygwin). But they don't have to be. This provides a less "Linux-like" experience but may be a good compromise if all you want are some Linux command line tools and don't need to install full-blown Linux executables.
Definition of PATH for both "environments" is different. Check that node's dir shows up on Git bash's and not in WSL Bash. Run this on both environments:
echo $PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With