windows - 混帐庆典 : how to change where the MinTTY configuration file is stored?

标签 windows git

我正在使用 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/

相关文章:

c++ - 对于大小为 4096 的缓冲区,最快的校验和算法是什么?

git log 并显示在一个裸仓库上

git - 如何将文件夹从一个 git repo 链接到另一个 repo?

git - 从化石导出到 git

windows - 以编程方式扩展/自定义 Windows 登录提示

windows - Azure 服务器中的 Laravel 队列

linux - 无法通过 samba 从 Windows 访问 GlusterFS 安装卷

git:git 可以意识到我从一个远程接收到的提交与来自不同远程的提交相同吗?

git - 如何防止 git gc 在 fetch 过程中自动运行

windows - SetThreadPriority 和 SetPriorityClass