Start Git Bash from users directory

2

I am running the latest version of git on Windows. When I start Git Bash (Running MINGW32) from my start menu it starts git from my users home directory. When I pin the window to the task bar and then click on it from the task bar it starts in the C:\ directory. Is there a way where I can get it to always start from my users directory?

Get Off My Lawn

Posted 2015-12-17T19:08:47.283

Reputation: 1 003

Did you found a solution? – Beat – 2016-02-18T08:47:24.083

No, but does seem to be displaying from my home directory now... – Get Off My Lawn – 2016-02-18T15:38:43.463

Here is a solution from stack overflow: https://stackoverflow.com/questions/19916670/how-to-launch-a-git-bash-window-with-particular-working-directory-using-a-script

– Raghu Ranganathan – 2018-04-10T14:40:27.860

Answers

0

Add this line to your .bashrc file:

cd <location>;

If the .bashrc file doesn't exist, create one in your home folder. For me, it's C:\Users\username\

Save .bashrc and open Git Bash.

Vikrant Sharma

Posted 2015-12-17T19:08:47.283

Reputation: 11

That isn't working. I tried cd ~ and cd /c/Users/rnaddy neither worked. I also closed and reopened bash. – Get Off My Lawn – 2018-04-10T14:59:57.633

if I run source ~/.bashrc it seems to work, just not on startup – Get Off My Lawn – 2018-04-10T15:00:56.760

got it, I had to add it to ~/.bash_profile – Get Off My Lawn – 2018-04-10T15:07:06.583