the TMP/TEMP directory in Windows 10 usually points to C:\Users\<user>\AppData\Local\Temp. When using Git bash, the /tmp directory "magically" refers to that location, too.
How can I change this behavior upon startup of the Git bash such that TMP, TEMP (for Windows programs started by Git bash) and the /tmp location refer to a different directory, e.g. C:/myTemp?
(Changing TMP or TEMP globally in Windows is not a viable option for me...)
In /etc/fstab, comment out any existing lines defining /tmp, and add this one:
C:/myTemp /tmp ntfs auto
The ntfs part doesn't matter because the system figures out the filesystem on its own. The auto part tells the system to mount it automatically when you start your shell. There are other options you might want to specify, like case sensitivity. For more information about that file, see:
https://cygwin.com/cygwin-ug-net/using.html#mount-table
After editing that file, you'll need to open a new shell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With