我正在使用 Portable Git,但它仍会在我的用户主文件夹中创建一些文件。我想要完全的便携性。
我关注了this answer并将 HOME
变量设置为指向我创建的文件夹 PortableGit\home\user
(其中 PortableGit
是我的 Git 安装文件夹)。现在我发现在我 change the font size 之后创建的 .minttyrc
配置文件仍存储在我的用户主文件夹中,而不是 \home\user
。
如何让 git-bash 在我指定的文件夹中存储和运行 MinTTY 的配置文件?
更改 HOME 变量对全局 .gitconfig 文件成功起作用。通过这个可移植 Git 安装,我将在我的计算机上处理存储库,以及位于我的 USB 上的存储库,如果这些信息很重要的话......
最佳答案
考虑 mintty wiki Tips :
For its configuration file, it reads
/etc/minttyrc
,$APPDATA/mintty/config
,~/.config/mintty/config
,~/.minttyrc
, in this order.For resource files to configure a colour scheme, wave file for the bell character, or localization files, it looks for subfolders themes, sounds, or lang, respectively, in one of the directories
~/.mintty
,~/.config/mintty
,$APPDATA/mintty
,/usr/share/mintty
, whichever is found first.The
~/.config/mintty
folder is the XDG default base directory. The$APPDATA/mintty
folder is especially useful to share common configuration for various installations of mintty (e.g. cygwin 32/64 Bit, MSYS, Git Bash).
在您的情况下,尝试移动 C:\User\<yourLogin>\.minttyrc
向右HOME
文件夹并通过再次启动 bash session 查看它是否被考虑在内。
确保 HOME
已经定义为User环境变量,你打开一个新的Window,才能继承这个环境变量的新值。
关于windows - 混帐庆典 : how to change where the MinTTY configuration file is stored?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47277001/