How to change the HOME directory and run the directory on MSYS2?

I installed MinGW-w64 and MSYS2. But how do I change the HOME directory in MSYS2? So when I type cd $ home or cd ~, it goes to another directory that I defined.

And how do I write code so that the source directory is always where the .bat file is located?

In cmd, I used this code:

% ~ d1 cd "% ~ p1" call cmd

so when I open cmd on my desktop, it starts with a directory on the desktop.

How can I do this with msys2?

+4
source share
3 answers

Windows MSYS2, /etc/nsswitch.conf :

db_home: windows
+6

(, ~/.bash_profile, ~ / ) $HOME:

export HOME=/something/else

, , cd ( ) $HOME; .

+1

, HOME:

set HOME=C:\Users\%USERNAME%
C:\LocalApp\PortableGit\git-bash.exe

.bash_profile ( , , ).

0

Source: https://habr.com/ru/post/1617640/


All Articles