Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change my Git home folder? [duplicate]

How do I change my git home folder? Currently my git folder is located in my %AppData% folder. I store my projects in my C:\Projects folder. I would like my git bash to start up in my C:\Projects folder and whenever I cd to my home directory (cd ~) I want it to navigate to C:\Projects.

like image 258
Tommy Saechao Avatar asked Jul 11 '16 22:07

Tommy Saechao


People also ask

How do I change the home directory in Git?

To change the default startup directory of Git Bash, do the following steps: Right-click on Git Bash's shortcut icon and go to the Properties. In the Start in field, paste the path to the desired folder, e.g. D:\WorkDir. Remove --cd-to-home from the Target field if it exists.

How do I change my home drive in Git bash?

Quick'n'dirty solution Save it, open Git Bash and execute cd ~ . You should be in a directory /c/my/custom/home now. Everything that accesses the user's profile should go into this directory instead of your Windows' profile on a network drive.

How do I change the default folder in GitHub?

Hit Alt-T , press options and then you can change the default storage directory. Show activity on this post. Git will by default clone into a new subdirectory of the current directory, so you could simply set up whatever shell/terminal you're using to start in the C:\Users\\Documents\GitHub directory by default.


1 Answers

Maybe this is what you want:

cd /c/projects

EDIT:
if you want it to start up within this directory, then just do this in cmd(admin):

setx HOME "C:\Projects"

after this you need to restart git-bash.
To test variable enter this in git-bash:

echo $HOME
like image 179
BladeMight Avatar answered Sep 29 '22 22:09

BladeMight