Git bash change default location .ssh

I am trying to change the location of .ssh to git bash.

When I open the git bash command line, I type cd ~ / .ssh, then my git bash goes to some directory H: /xyz/.ssh. I want to change it to some directory D: /user/.ssh. Sorry, I do not have experience on UNIX, but tried to find ways on the Internet. Please inform.

+6
source share
1 answer

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 one) to say something like

export HOME="/d/user" 

Next time you run 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 on Windows. The links also mention how you can change the startup folder by changing the properties of the shortcut.

Similar questions with answers can be found here and here .

+2
source

Source: https://habr.com/ru/post/953501/


All Articles