I am new to using Git Bash and Git Hub. Upon installing Bash, I accepted all of the default settings. In doing so, made my network drive the default directory. I will be using this offline and need to change the default directory to my local drive. I have tried to change the location path of GitBash to the local drive but did this did not work. How can I change this? Also, is there any alterations that need to be made to the GitHub account?
-
What about doing a clean re-install of Git bash? – Julian Go Aug 18 '15 at 14:11
-
Possible duplicate of [How do I change the default location for Git Bash on Windows?](https://stackoverflow.com/questions/7671461/how-do-i-change-the-default-location-for-git-bash-on-windows) – Stevoisiak May 07 '18 at 15:29
4 Answers
In my case I had to take the following steps to change the default startup directory of the Git Bash in Windows:
1) Right click on the Git Bash icon in your Windows Start menu and select Properties. In Windows 10 you may have to right click on Git Bash -> More -> Open file location -> Right click on the shortcut -> Properties
2) In the Start in
field, paste the path to your desired folder, e.g. D:\git
.
3) Remove --cd-to-home
from the Target
field.

- 7,428
- 4
- 33
- 42
-
1followed the same steps Not working for me any idea, thoughts – Siluveru Kiran Kumar Sep 14 '19 at 15:36
You can modify the shortcut to Git Bash in order to specify the starting directory. This is discussed here.
Alternatively you can create a file called .bashrc
in your home directory. That script is executed when the shell starts (rc stands for run-commands), so you can make that file cd
into whatever directory you like.

- 1
- 1

- 300,895
- 165
- 679
- 742
-
@siluverukirankumar why not? You should have write permission to your home directory. – Drew Noakes Sep 16 '19 at 09:02
-
I am able to create another file but I am not able to create .bashrc file – Siluveru Kiran Kumar Sep 17 '19 at 06:41
-
@siluverukirankumar what error does it give you? Does the file already exist? – Drew Noakes Sep 17 '19 at 22:52
You can also do it from CMD:
start /D "path_target_on_windows_here" git_bash_path\git-bash.exe
It is useful for configuring a shortcut command on Notepad++ :]

- 111
- 1
- 6
Try creating .bashrc
, refer to this solution
https://shawnhymel.com/576/quick-tip-changing-default-directory-of-git-bash/

- 517
- 1
- 5
- 12