Set Git Bash default path
How to change the default directory for Git Bash
less than a minute
Git for Windows includes a tool called Git Bash, which gives you a bash shell you can use to run git via the command line.
To set the Git Bash default directory, change the Start in field on the Shortcut tab of the Git Bash properties.
Here’s how:
-
Right-click the Git Bash icon in the taskbar to display the taskbar shortcut menu.
-
Right-click the Git Bash command in the taskbar shortcut menu and then select Properties.
-
If the Target field includes the
-cd-to-home
option, remove it. -
Set Start in to the directory you wish to use.
Use the Windows
cmd
path naming convention, instead of Unix.For example:
c:\mypath\myrepos
instead of/c/mypath/myrepos
. -
When finished, select OK or press
Enter
.
If necessary, exit and restart Git Bash.
Vital statistics
- 7 May 2024: Rewritten and updated for site revamp
- 2 June 2018: First post