How to set the startup directory in Git Bash?
Here is a quick fix;
Instead of opening git and navigating to the folder you want by using cd /long/path/to/your/files do as below;
In Windows 10,
- Go to any folder you like.
- Right click
- Click Open Git here
- Then Git will automatically open in the selected folder.
Here is how it looks when you right click
Right click on the shortcut, and select properties. Navigate to the "shortcut" tab.
There are two things you need to change here. First, by default, the Target field will end in --cd-to-home
- remove it. Once you've done that, you can edit the Start in
field and give it any directory you want.
E.g., this is how the shortcut looks on my machine:
After editing, you'll have:
You could also, of course, create multiple Git Bash shortcuts to start in each directory you're interested in.