Loading...
 
JoiWiki » Developer » Applications » Git » Git Concepts and Setup » Changing Home for Git Changing Home for Git

Changing Home for Git


As I mentioned Git makes use of the Home variable and when using networks that like to set your home location to somewhere specific to that network it can cause issues when you then attempt to use Git when not connected to that network. This was something that I faced with a work laptop and had to work around.

 

Change home just for Git

Fortunately you can reasonably easily work around this and without messing aroung with your environment variables at all!. Simply navigate the the following file:

C:\Program Files\Git\etc\profile

and add a line at the bottom designating where you'd like your new home to be for the purposes of Git:

HOME="/c/Users/jbaker/BashHome"

 

This will enable you to set your ssh information in one easily navigable place, hold all of your ssh keys there and not have anything overwritten by network settings.

 

DId it work?

The easiest way to find out whether it's done the job is to close your cmd windows, open a new one and type the following into bash:

echo $HOME


 

 

 

 

 

 

Created by JBaker. Last Modification: Monday January 23, 2023 09:37:36 GMT by JBaker.

Developer