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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With