我如何在cmder中运行msysgit? [英] How do I run msysgit in cmder?

查看:99
本文介绍了我如何在cmder中运行msysgit?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我意外退出它时,我在cmder中使用了msysgit和git-bash。

现在我似乎无法弄清楚如何进入我之前使用的unix环境。



Git bash不被识别为命令。

我所看到的是典型的命令窗口提示符,显示 C: / User /..而不是 $〜User



你会如何恢复git bash会话?

解决方案

可以键入 msysgit intallation(2014,Git 1.9.z)的完整路径以启动一个

例如:


  • c:\prgs\git\PortableGit-1.9.0-preview20140217\Git Bash.vbs:将打开一个新窗口

  • c:\prgs\git\PortableGit-1.9.0-preview20140217\git-bash.bat:将在当前shell中打开一个bash会话。



这两个脚本不是< msysgit / bin> 文件夹的一部分,并且在%PATH%中找不到。



正如 David Grayson pred 的评论中,使用<一个href =https://github.com/msysgit/msysgit/releases/download/Git-1.9.5-preview20141217/Git-1.9.5-preview20141217.exe =nofollow noreferrer> Git-1.9.5-preview20141217.exe 确实会导致安装(在C:\ Program Files文件中),而不是安装git-bash.bat ,并依赖于Git Bash快捷方式调用 C:\Git\bin\sh.exe --login -i



不要使用该设置。使用更容易和更完整的软件包 PortableGit-1.9.5-preview20141217.7z ,您可以将其解压缩到任何位置并添加到PATH中。




注意:新的 Git for Windows版本(2015, Git 2.yz),那就是:


  • c:\prgs\ git \PortableGit-2.3.5.8-dev-preview-64-bit\git-bash.exe :将在当前shell中打开一个bash会话。


I was using msysgit and git-bash in cmder when I accidentally exited out of it.
Now I can't seem to figure out how to get to the unix environment I previously had.

Git bash is not recognized as a command.
All I see is the typical command window prompt displaying the C:/User/.. rather than the $~User.

How would you restore the git bash session?

解决方案

You can type the full path of your msysgit intallation (2014, Git 1.9.z) to launch a bash session.

For instance:

  • "c:\prgs\git\PortableGit-1.9.0-preview20140217\Git Bash.vbs": will open a new windows
  • "c:\prgs\git\PortableGit-1.9.0-preview20140217\git-bash.bat": will open a bash session within the current shell.

Those two scripts aren't part of <msysgit/bin> folder, and are not found in %PATH%.

As commented by David Grayson and pred below in the comments, using Git-1.9.5-preview20141217.exe does result in an installation (in C:\Program File) which does not have git-bash.bat, and which rely on "Git Bash" shortcut calling C:\Git\bin\sh.exe --login -i.

Don't use that setup. Use the much easier and more complete package PortableGit-1.9.5-preview20141217.7z that you unzip anywhere you want and that you add to your PATH.


Note: with the new Git for Windows releases (2015, Git 2.y.z), that would be:

  • "c:\prgs\git\PortableGit-2.3.5.8-dev-preview-64-bit\git-bash.exe": will open a bash session within the current shell.

这篇关于我如何在cmder中运行msysgit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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