A.Papuccu
A.Papuccu

Reputation: 77

gitbash change default directory

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

Answers (1)

cam
cam

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:

  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

Upvotes: 8

Related Questions