Portable Git and GitHub: SSH keys

I downloaded the portable version of Git for Win32, which comes in a self-extracting package. I wanted to be able to commit from anywhere (my flashdrive), but I have no idea how to use a public key that does not belong to users /USERNAME/.ssh. How to configure Git to automatically use keys in another directory?

(I can generate keys in other directories, but Git automatically sends the keys to c: /users/me/.ssh)

NOTE. I am using Win32! Not Linux or OSX!

+5
source share
2 answers

msysgit will actually use the public / private keys in %HOME%/.ssh.

By default, msysgit defines HOME on C:\users\USERNAME, but there is nothing stopping you from determining HOMEany path you want.

Just define the environment variable HOME'and then all your shell / DOS sessions inherit this new value.

+4
source

You can add your directory to ~ / .bashrc or ~ / .bash_profile. You can also try changing the user's home directory.

+1
source

All Articles