简体   繁体   English

git 没有 bash/cygwin

[英]git without bash/cygwin

I'm on a vista laptop, trying out git for the first time.我在 vista 笔记本电脑上,第一次尝试 git。

I installed the msysgit version , and it installed a "git bash" shortcut on the desktop.我安装了 msysgit 版本,它在桌面上安装了一个“git bash”快捷方式。 When I run it, it seems to run in a cygwin kind of box, where C:\ is /c/当我运行它时,它似乎在 cygwin 类型的盒子中运行,其中C:\/c/

Is it safe to use git from the windows command line where /c/ is C:\ ?从 windows 命令行中使用 git 是否安全,其中/c/C:\ does that create any conflict with the way git expects the pathes to be like?这是否与 git 期望路径的方式产生任何冲突?

What about, if I init from the bash/cygwin console, then commit from the windows console?怎么样,如果我从 bash/cygwin 控制台启动,然后从init控制台commit Does that create any trouble?这会造成任何麻烦吗?

Note: Keep in mind that git does not track where the repository is at -- just references.注意:请记住,git 不会跟踪存储库的位置——只是引用。 In other words you can cleanly move an entire git directory (.git + working tree) and it still works fine.换句话说,您可以干净地移动整个 git 目录(.git + 工作树),它仍然可以正常工作。

It should work in either case assuming your environment variables allow you to run git from the windows command line.假设您的环境变量允许您从 windows 命令行运行 git,它应该在任何一种情况下都有效。

Both point to the same actual directories (although referenced differently), and use the same executable to modify the repository.两者都指向相同的实际目录(尽管引用方式不同),并使用相同的可执行文件来修改存储库。

When you install MSYS Git, it will give you 3 options related to system paths.当您安装 MSYS Git 时,它将为您提供 3 个与系统路径相关的选项。 Which one you choose will determine how you can use it.您选择哪一个将决定您如何使用它。 It sounds like you want the 3rd option, "Run Git and included tools from the windows command prompt".听起来您想要第三个选项,“运行 Git 并包含来自 windows 命令提示符的工具”。 This will put all of the git-related binaries in the system path, allowing you to use git from a normal command prompt.这会将所有与 git 相关的二进制文件放在系统路径中,允许您从普通命令提示符使用 git。 Be aware that it also overrides a few built-in windows tools, as the warning in the installer says.请注意,正如安装程序中的警告所说,它还覆盖了一些内置的 windows 工具。

After installing msysgit, you should be able to right click on an empty folder and see options "Git GUI here" and "Git BASH here".安装 msysgit 后,您应该能够右键单击一个空文件夹并看到选项“Git GUI here”和“Git BASH here”。 If you click Git GUI here it will open a GUI.如果您在此处单击 Git GUI,它将打开一个 GUI。 Have fun!玩得开心!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM