如何更改 Windows 上 Git Bash 的默认位置? [英] How do I change the default location for Git Bash on Windows?

查看:33
本文介绍了如何更改 Windows 上 Git Bash 的默认位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 7 上使用 Git,并通过 Git Bash 访问我的存储库.如何更改 Git Bash 在启动时在方便的文件夹中打开的默认位置?

I am using Git on Windows 7 and access my repositories through Git Bash. How can I change the default location that Git Bash opens in a convenient folder when I start it?

导航到 htdocs,然后导航到特定文件夹有点费时.有没有办法改变配置文件让它在别处打开?或者是否可以编写一个 .sh 文件来执行此操作?

It's somewhat time consuming to navigate to htdocs, and then a specific folder. Is there a way to change the configuration file to have it open elsewhere? Or would it be possible to write a .sh file to do this?

不幸的是,Git Bash 不会在我的桌面上打开我的 htdocs 文件夹快捷方式,并且需要使用 cd 5 次才能到达我想要的目录.

Unfortunately Git Bash won't open my htdocs folder shortcut on my desktop, and it takes using cd 5 times to get to my desired directory.

推荐答案

安装 msysgit 后,我​​在 Windows Explorer 的上下文菜单中有 Git Bash here 选项.所以我只是简单地导航到该目录,然后在那里打开 Bash.

After installing msysgit I have the Git Bash here option in the context menu in Windows Explorer. So I just simply navigate to the directory and then open Bash right there.

我还将默认的 Git Bash 快捷方式复制到桌面,并编辑了它的 Start in 属性以指向我的项目目录.它完美无瑕.

I also copied the default Git Bash shortcut to the desktop and edited its Start in property to point to my project directory. It works flawlessly.

Windows 7x64,msysgit.

Windows 7x64, msysgit.

这篇关于如何更改 Windows 上 Git Bash 的默认位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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