Windows Git - 拾取碎片

时间:2016-03-30 23:53:31

标签: git bash git-bash .bash-profile

我刚安装了最新版本的Git for Windows,当我打开命令shell(我首选使用Git的方式)时,我之前的所有设置/快捷方式/别名等都消失了。

Git附带的旧版Bash将我的主目录定位到我的Windows用户主目录,并且我有.bashrc.gitconfig这样的文件最终为我的Git体验设置了一切。

我的所有Bash配置文件都保留在此Windows用户目录中,但新安装似乎没有查找设置信息。

有人可以告诉我如何恢复所有这些以便新的Git shell看起来这些设置吗?

1 个答案:

答案 0 :(得分:1)

从Git 2.5.0开始,.bashrc不再指向Windows下的%USERPROFILE%\.bashrc,所以我假设您从早期版本升级。

该文件的新位置为:C:\Program Files\Git\etc\bash.bashrc。 编辑文件,将旧内容添加到文件中,它应该可以正常工作。

要查看文件类型,这是您的浏览器地址栏:

file:///C:/Program%20Files/Git/etc/bash.bashrc

<强> Another option

 # git (windows version >2.5) is not looking for .bash_profile instead of 
 # .bash so you can simply rename your file to the new name
 mv ~/.bashrc ~/.bash_profile