Reputation: 77
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?
Upvotes: 4
Views: 6119
Reputation: 5198
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:
Search for "Git Bash" in the start menu
Right click to open folder location
Right click "Git Bash" and open properties window
Remove the --cd-to-home
flag from the "Target" field
Set your desired path in the "Start in" field (you will need admin privileges to change this)
Before
After
Upvotes: 8