Windows 上的 msysgit —— 如果有的话,我应该注意什么? [英] msysgit on windows -- what should I be aware of, if any?

查看:21
本文介绍了Windows 上的 msysgit —— 如果有的话,我应该注意什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与我最近问的另一个问题有关.

This is related to another question I asked recently.

安装 msysgit 时,安装程​​序会提供 3 个与系统路径相关的选项:

When installing msysgit, the installer presents 3 options related to system path:

  1. 永远不要改变 Windows 环境.使用此选项,您必须使用bash"shell 来处理 git.

  1. Never change windows environment. With this option, you have to use the "bash" shell to work with git.

将 gitin 目录添加到 PATH 环境变量中,但不要覆盖一些内置的 Windows 工具.研究员 stackoverflow-ian Gabe Moothart 在评论中告诉我这个选项将使一些 git 操作失败!这些操作是什么?我应该担心他们吗?

Add the gitin directory to the PATH environment variable, but without overriding some builtin windows tools. Fellow stackoverflow-ian Gabe Moothart told me in a comment that this option will make some git operations fail! What are these operations? Should I worry about them?

与 2 相同,但会覆盖一些默认系统工具.这些工具是什么?窗户的哪些部分依赖于它们?这在实践中会受到伤害吗?

Same as 2 but override some default system tools. What are these tools? What parts of windows depend on them? and will this hurt in practice?

我想到了另一个与系统路径无关的问题.

Another issue has come to my mind, unrelated to the system PATH.

如果我的项目目录中有符号链接和硬链接怎么办?git 知道如何处理这些吗?或者,它是否会受到无限递归的影响,如果说,目录结构是这样的,某个文件夹实际上是到其父文件夹之一的符号链接?

What if I have symbolic links and hard links inside my project directory? Does git know how to deal with these? or, will it suffer from infinite recursion, if say, the directory structure was such that some folder was actually a symbolic link to one of its parents?

推荐答案

无论你选择哪个选项,你都会得到 bash,后者只是添加了在它之外使用 Git 的方法.

You get bash regardless of which option you pick, the latter options just add methods for using Git outside it.

对于后一个选项,msysgit 将常见 Linux 实用程序的 Windows 版本添加到 PATH.这包括findkillsort,以及cplsrm,以及大约 20-30 个人.

For the latter options, msysgit adds Windows builds of common Linux utilities to PATH. This includes find, kill and sort, as well as cp, ls, rm, and about 20-30 others.

前 3 个(和类似的)的问题在于它们存在于两个操作系统中,并且在每个操作系统中的功能不同.

The problem with the first 3 (and similar) is that they exist in both OSs and function differently in each.

如果您知道将使用哪一个,这不是什么大问题,但任何开发的应用程序都期待一个并获得另一个肯定会适得其反.

Not a huge ordeal if you know which one you'll be using, but any applications developed expecting one and getting the other will surely throw a fit.

为了防止冲突,同时仍然让 Git 按预期工作,您可以创建一个简单的批处理脚本,只为会话调整 PATH.(例如,readygit.bat)

To prevent the conflict, while still having Git work as expected, you can create a simple batch script that adjusts PATH only for the session. (e.g., readygit.bat)

@echo off
setlocal
set PATH=C:Gitin;%PATH%
cmd

相应地调整C:Gitin.但是,只需运行它并在 cmd 中使用 Git.

Adjust C:Gitin accordingly. But, just run this and use Git within the cmd.

有了这个,您可以使用安装选项 3 并安全地从系统的 PATH 中删除 C:Gitin,从而在不混淆 Git 的情况下消除对 Windows 应用程序的任何混淆.

With this, you can use install option 3 and safely remove C:Gitin from your system's PATH, removing any confusion for Windows apps without confusing Git.

我目前在 GnuWin 应用程序中使用类似的脚本,包括 <强>查找.

I currently use a similar script with GnuWin apps, including find.

这篇关于Windows 上的 msysgit —— 如果有的话,我应该注意什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆