Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitbash change default directory

Tags:

git-bash

I uploaded gitbash to my PC several days ago. However I selected the default directory as C:/users/myusername whenever I open it the default directory is somewhere else than my selected path. What can be causing this and how can I fix?

like image 705
A.Papuccu Avatar asked Oct 15 '25 13:10

A.Papuccu


1 Answers

EDIT: For how to change your default home directory path on Windows 10, see this answer but note that this may break other applications. To change where Git Bash opens, see my answer below.

By default, Git Bash will go to your home directory set by the environment variables %HOMEDRIVE%%HOMEPATH%.

This can be changed in the Git Bash program's properties:

  1. Search for "Git Bash" in the start menu

  2. Right click to open folder location

  3. Right click "Git Bash" and open properties window

  4. Remove the --cd-to-home flag from the "Target" field

  5. Set your desired path in the "Start in" field (you will need admin privileges to change this)

Before

Git Bash Properties Window

After

Git Bash Properties Window

like image 127
tentative Avatar answered Oct 18 '25 12:10

tentative



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!