Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Truly Portable Git

I'm trying to create a fully portable version of git on a USB drive with it's own SSH keys and I want it to work regardless of the drive letter windows gives it. I've installed portable git and most of it works. The problem I have is setting the $HOME to be dynamic I want it to point to /DRIVELETTER/PortableApps/PortableGit so when I generate and use my SSH keys it will go to /DRIVELETTER/PortableApps/PortableGit/.ssh/

Right now $HOME is / and it makes the default path for ssh generation //.ssh/id_rsa which doesn't exist. I have found site that say "SET IT TO /e/bla/bla/bla/" but that doesn't work if the drive letter is J.

I have not found any good guides to setting up truly portable git.

Thanks for any help Munchies

like image 555
Munchies Avatar asked May 09 '12 21:05

Munchies


1 Answers

In a batch file first do

for /F "delims=\: usebackq" %%i in (`cd`) do SET USB_DRIVE=%%i

then the rest of the time (in batch files) use %USB_DRIVE% instead of d: or whatever letter it is.

like image 94
Rob Kam Avatar answered Oct 08 '22 12:10

Rob Kam