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

查看:182
本文介绍了如何在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 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文件夹快捷方式,它需要5 cd s到达我想要的目录。

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

推荐答案

安装msysgit I在Windows资源管理器的上下文菜单中有 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 快捷方式到桌面并编辑其开始属性指向我的项目目录。它完美无瑕。

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天全站免登陆