从Windows通过Cygwin运行Git [英] Running Git through Cygwin from Windows
问题描述
我最近开始使用Cygwin用于其他用途,并且已经在我的电脑上安装了Git。我理解我可以运行可执行文件,并安装Git到Cygwin,但由于我已经安装
我想Cygwin只使用我的Windows安装。我已经尝试研究如何以各种方式重定向路径,但没有成功,有人可以帮助我吗?
确认git和msysgit可以在同一台计算机上共存,如)。
在这里,你可以做一个 sudo apt-get install git-core
并且开始使用在WSL容器的本地文件系统(见下文)或在托管Windows的文件系统中的项目源上通过 / git mnt / c /...
, / mnt / d /...目录层次。
专门用于 Windows上的Bash 或 WSL (适用于Linux的Windows子系统):
- 这是一个轻量级的虚拟化容器(技术上,Drawbridgepico-process ,
- 托管未修改的无头Linux发行版(即
,
- 可以执行基于终端的命令(甚至X服务器客户端应用程序,如果 Windows服务器 ), .com / wsl / 2016/06/15 / wsl-file-system-support /rel =nofollow noreferrer>模拟访问Windows文件系统(意味着除了性能降低,对于
DrvFs
模拟文件系统中的文件,可能不会像VolFs
档案系统)。
- 可以执行基于终端的命令(甚至X服务器客户端应用程序,如果 Windows服务器 ), .com / wsl / 2016/06/15 / wsl-file-system-support /rel =nofollow noreferrer>模拟访问Windows文件系统(意味着除了性能降低,对于
<很抱歉,无法调用回 Windows 可执行档,或
- 与任何原生驱动程式互动所以没有图形卡,没有USB驱动器)。
I have started using Cygwin recently for other purposes and already have Git installed on my PC. I understand I can run the executable and install Git into Cygwin, but since I already have it installed I would like Cygwin to just use my Windows installation. I have tried researching how to make the path redirect in various ways but with no success, can someone help me out?
I confirm that git and msysgit can coexist on the same computer, as mentioned in "Which GIT version to use cygwin or msysGit or both?".
Git for Windows (msysgit) will run in its own shell (dos with
git-cmd.bat
or bash withGit Bash.vbs
)
Update 2016: msysgit is obsolete, and the new Git for Windows now uses msys2Git on Cygwin, after installing its package, will run in its own cygwin bash shell.
- Finally, since Q3 2016 and the "Windows 10 anniversary update", you can use Git in a bash (an actual Ubuntu(!) bash).
In there, you can do a sudo apt-get install git-core
and start using git on project-sources present either on the WSL container's "native" file-system (see below), or in the hosting Windows's file-system through the /mnt/c/...
, /mnt/d/...
directory hierarchies.
Specifically for the Bash on Windows or WSL (Windows Subsystem for Linux):
- It is a light-weight virtualization container (technically, a "Drawbridge" pico-process,
- hosting an unmodified "headless" Linux distribution (i.e. Ubuntu minus the kernel),
- which can execute terminal-based commands (and even X-server client apps if an X-server for Windows is installed),
- with emulated access to the Windows file-system (meaning that, apart from reduced performance, encodings for files in
DrvFs
emulated file-system may not behave the same as files on the nativeVolFs
file-system).
- Unfortunately, it cannot invoke back into Windows executables, or
- interact with any native drivers (i.e. so no Graphic card, no USB drives yet).
这篇关于从Windows通过Cygwin运行Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!