4

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...)

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.