[英]Make Windows Git Bash terminal look to a custom location for .bashrc & .bash_profile
On Windows I have installed Git Bash. 在Windows上,我已经安装了Git Bash。 My
HOMEPATH
& HOMEDRIVE
environment variables are set so that my home directory is M:\\
. 设置我的
HOMEPATH
& HOMEDRIVE
环境变量,以便我的主目录为M:\\
。 As of now I have my .bashrc
& .bash_profile
files sitting at M:\\
& they work just fine. 截至目前,我的
.bashrc
和.bash_profile
文件位于M:\\
,并且工作正常。
My question: Is there a way to have Git Bash look somewhere other than M:\\
for .bashrc
& .bash_profile
without changing my HOMEPATH
& HOMEDRIVE
environment variables? 我的问题:有没有一种方法可以让Git Bash在
.bashrc
和.bash_profile
M:\\
之外的其他位置上显示,而无需更改我的HOMEPATH
和HOMEDRIVE
环境变量?
For example, I want to keep my system's home directory at M:\\
but move .bashrc
& .bash_profile
to C:\\my\\new\\location
. 例如,我想将系统的主目录保留在
M:\\
但是将.bashrc
和.bash_profile
移到C:\\my\\new\\location
。
Those .bash*
files are referenced by HOME
, so simply set (create) the HOME
environment variable to C:\\my\\new\\location
这些
.bash*
文件由HOME
引用,因此只需将HOME
环境变量设置(创建)为C:\\my\\new\\location
Then open a bash session and check that your resource files are sourced. 然后打开一个bash会话,并检查您的资源文件是否来源。
HOMEPATH
and HOMEDRIVE
will be unchanged. HOMEPATH
和HOMEDRIVE
将保持不变。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.