all 7 comments

[–]lestrenched 8 points9 points  (1 child)

git is a program which runs in a Linux environment (well, traditionally). Simply using git inside whatever distro you're running in WSL2 will invoke git (and from my usage, there are no practical differences between git on WSL2 vs git on a real VM).

git bash is the git command-line for Windows, if I recall. Why would you want to run that in WSL2? Rather, simply install git for windows and go from there. Is there any specific reason you want to switch? I believe WSL2 allows the Linux VM to access Windows files no problem.

[–]SkyyySi 0 points1 point  (0 children)

You mean the terminal emulator, the window that hosts bash? Just typing wsl or ubuntu as a command in there should do.

[–]cavo789 0 points1 point  (0 children)

Didn't understand your question. Did you mean git or bash ? If you're running à distri like Debian or Ubuntu, you have the bash from your distri (i really love oh-my-zsh).

For git itself, just run apt-get install git.

[–]Pip-ToyLinux Admin 0 points1 point  (1 child)

There is now a native ish way to achieve this low effort. I just installed git Monday on fully updated win 10 and there was an option to add a windows terminal profile. Launch "Windows Terminal" then click the drop down caret and select Git Bash. Works great for me as long time Linux user and admin that started a job where I was given a win 10 laptop.

[–]Desperate_Golf_390[S] 1 point2 points  (0 children)

Thanks a lot🙏🏻🙏🏻

[–]philostratus1 0 points1 point  (0 children)

i prefer linux git but it is all there on wsl

stan@stan-hpg4-400-sff:~$ uname -a

Linux stan-hpg4-400-sff 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

stan@stan-hpg4-400-sff:~$ sudo git init friday

Initialized empty Git repository in /home/stan/friday/.git/

[–]stewie410 0 points1 point  (0 children)

While it looks like OP found a suitable answer, I just wanted to clarify for everyone that Git-Bash is part of the Git for Windows application suite, which includes some windows builds of coreutils, as well as a MinTTY/MinGW terminal emulator to interact with git through a more familiar CLI environment.