Windows Git - 捡起碎片

Windows Git - picking up the pieces

我刚刚为Windows安装了最新版本的Git,当我打开命令shell(我的使用 Git 的首选方式)。

Git 附带的旧版本 Bash 将我的主目录定位到我的 Windows 用户主目录,在那里我有 .bashrc.gitconfig 最终为我的 Git 体验做好了一切准备。

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

谁能告诉我如何恢复所有这些,以便新的 Git shell 可以查看这些设置?

从 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