I have been struggling to change .ssh location on git bash.
When I open Git Bash command prompt, I'm typing cd ~/.ssh then my Git Bash navigates to some H:/xyz/.ssh directory. I want to change it to some D:/user/.ssh directory. Sorry, I'm not experienced on UNIX but tried some ways found on internet in vain. Please advise.
In order to change your HOME variable (containing the path to your home directory) you can try different approaches.
The linux "inhouse" solution would be to edit your ~/.bashrc file (or create it) to say something like
export HOME="/d/user"
Next time you start GitBash, and type
cd ~/.ssh
it will go into /d/user/.ssh if the directory exists.
Now according to danlimerick and GregK you can also set the HOME variable directly in Windows. The links also mention how you can change the startup folder via changing the shortcut properties.
Similar questions with answers can be found here and here.
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