1

My home directory in CMD/Git Bash is a network drive H:\. I want my directory to be the same as my user profile C:\Users\Phil. I don't want to have a network drive be my home directory because it's much slower. How can I change this?

When I enter cd ~ I want it to go to C:\Users\Phil instead of the network drive.

Philip Rego
  • 225
  • 2
  • 12
  • This could help you : https://superuser.com/questions/1735979/how-to-navigate-to-desktop-when-desktop-is-on-seperate-drive/1736002#1736002 – S. Brottes Aug 09 '22 at 20:05
  • @S.Brottes that only changes where it starts. If I enter `cd` it will go back to `H:` drive. Also `.ssh` and `.bashrc` will continue to be searched for on `H:` drive. – Philip Rego Aug 09 '22 at 20:10
  • 1
    Here seems to be exactly your problem https://superuser.com/questions/246731/how-do-i-change-homedrive-homepath-and-homeshare-in-windows-xp – S. Brottes Aug 09 '22 at 20:13
  • @S.Brottes great! `net use h: /delete` worked. Home drive in Git Bash is now `C:\Users\Phil` and `C:\WINDOWS\system32` in CMD which I'm fine with. – Philip Rego Aug 09 '22 at 20:24

1 Answers1

1

Edit: This removed my H: drive but I'm still able to access the drive with the network path. Make sure you record the network path of the drive before using this command.

In command prompt enter net use h: /delete replace h: with the current home directory you wish to change. This will remove your network drive. Now when I type cd it goes to C:\Users\Phil

Credit to S. Brottes for finding this answer.

Philip Rego
  • 225
  • 2
  • 12