Search code examples
gitgit-bashworking-directory

How to set the startup directory in Git Bash?


What is the command to set startup directory in Git Bash?

When I start Git Bash, the startup directory is Bitbust directory in C drive, so I must change the working directory with cd command.

But I think it is an unnecessary process. I want the startup directory to be my working directory where Git Bash is started.


Solution

  • 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:

    enter image description here

    After editing, you'll have:

    enter image description here

    You could also, of course, create multiple Git Bash shortcuts to start in each directory you're interested in.