gitpowershellwindows-subsystem-for-linuxposh-git

Git recommendations, cygwin, WSL, PowerShell posh-git Module


I'm quite new to using git, so I'm not very knowledgeable, but have some questions, specifically about using git on Windows.

Advice from experts on which of the above would be most efficient and sensible would be appreciated.


Solution

  • If you want a native Windows version of Git, the recommended option is Git for Windows, which you can download from that link or with Chocolatey. Because Git is designed for Unix, you do need a POSIX shell and a POSIX environment, which is shipped with Git for Windows. This is based off of MINGW, not Cygwin, but it is required so that programs written in shell, as well as things that invoke the shell like your editor, work. posh-git doesn't change that.

    You can indeed use Git from WSL, but I would not recommend using it from a non-sh environment such as PowerShell. That's because a Unix Git will expect paths and such to be in the Unix format and won't accept any sort of Windows paths at all. So you can use WSL Git, but I strongly recommend using it from WSL and not PowerShell.