Setting Default Home Directory with Git Bash

Recently I was getting a new development environment set up and I needed Git Bash. I noticed that Git Bash would start at an l drive when I launched it, instead of my user’s home directory. To change the directory to your user’s actual home directory, simply execute the following command:

[code language=”bash”]
echo "cd /c/Users/[username]" >> /l/.bashrc
[/code]

Make sure to replace [username] with your actual username or ID. Also, be mindful that you will be appending to this file, if it already exists, or creating the .bashrc hidden file automatically with the contents of the echo.

Also, if you use shortcuts with alias‘es via the .bash_profile, you will need to modify or create the .bash_profile in the home directory Git Bash launches in (ie, the l drive). For example,

[code language=”bash”]
$ cat /l/.bash_profile
alias mci=’mvn clean install -DskipTests -U’
[/code]

4 Comments:

  1. Very clear website , regards for this post.

  2. Pretty element of content. I just stumbled upon your site and in accession capital to claim that I get actually loved account your weblog posts. Anyway I will be subscribing in your augment and even I success you access constantly fast.

  3. I needed to write you a tiny remark just to say thanks over again on the great solutions you’ve featured here. It has been so wonderfully generous of you to give freely just what many of us would have offered for an electronic book to make some dough on their own, most notably now that you could possibly have tried it if you considered necessary. Those smart ideas in addition acted as the fantastic way to fully grasp that many people have a similar keenness just like my personal own to realize more pertaining to this problem. I am sure there are numerous more pleasant periods in the future for those who find out your site.

  4. Woah! I’m really enjoying the template/theme of this blog. It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between superb usability and visual appearance. I must say you’ve done a amazing job with this. In addition, the blog loads extremely fast for me on Safari. Excellent Blog!

Leave a Reply

Your email address will not be published. Required fields are marked *