Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git bash change default .ssh location [closed]

Tags:

git

git-bash

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.

like image 972
IndoKnight Avatar asked Sep 09 '13 16:09

IndoKnight


1 Answers

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.

like image 62
x29a Avatar answered Oct 06 '22 02:10

x29a