Windows vs WSL上的git bash

Rhe*_*hee 8 git-bash windows-subsystem-for-linux

我在Windows上下载了git,并安装了其他一些东西,包括git bash。

Although I didn't know why bash terminal has been included in the "git", it supported not only the functions for git, but other functions like mkdir, cp, mv, just like a real linux bash terminal.

Recently I came to know the WSL (Windows Subsystem for Linux), which makes bash terminal available in windows.

Is the git bash quite inferior to WSL in terms of functionality?

Does it contain some constraints that WSL doesn't have?

Von*_*onC 17

Windows 版 Git正在使用 mingw-w64项目(如图所示)和msys2
请参阅“ msys、msys2 和 msysgit 之间有何关联? ”。

这与模拟实际 Linux 发行版的WSL大不相同。

它是否包含一些 WSL 没有的约束?

适用于 Windows 的 Git 基于POSIX兼容层,具有局限性自 Windows 8 起不推荐使用 POSIX 支持


注意:WSL 很快将被 WSL2 取代,它使用全新的架构,使用真正的 Linux 内核


如果您的程序依赖于 Git bash(而不是 WSL/WSL2 bash),请确保将适用于 Windows 的 Git 放在yourPATH 中,如Jon Skeet在“在AppVeyor CI 环境中使用“从 APPVEYOR 使用“GIT BASH” ”中所述

# Make sure we get the bash that comes with git, not WSL bash
  - ps: $env:Path = "C:\Program Files\Git\bin;$env:Path"
Run Code Online (Sandbox Code Playgroud)


小智 5

WSL不会触发文件处理程序时,该文件在Windows工具改变- https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps和工具/

因此,您无法在WSL中运行开发服务器,因为对Windows编辑器所做的代码更改将不会反映在开发服务器中。

  • 此问题已在版本 1903 中修复:https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/ (5认同)

归档时间:

查看次数:

7844 次

最近记录:

6 年,11 月 前