How to default to other directory instead of home directory

Xi 张熹 picture Xi 张熹 · Aug 10, 2011 · Viewed 159.3k times · Source

I am developing on a windows machine. The only place I need for linux command line is Git Bash. The problem is: When I open it, I am in the home directory. I have to change the directory to my workspace, like:

cd ../../../d/work_space_for_my_company/project/code_source

Can I wrap this in a .sh file so I don't have to hand-type it anymore? This should be simple but I have zero knowledge about Linux command line. I am really appreciated If you can walk me through how to create that .sh file.

Answer

David Siegal picture David Siegal · Sep 9, 2011

Here's a more Windows-ish solution: Right click on the Windows shortcut that you use to launch git bash, and click Properties. Change the value of "Start In" to your desired workspace path.

Edit: Also check that the Target value does not include the --cd-to-home option as noted in the comments below.