How do I change the default location for Git Bash on Windows?

后端 未结 18 1007
暗喜
暗喜 2020-11-28 01:32

I am using Git on Windows 7 and access my repositories through Git Bash. How can I change the default location that Git Bash opens in a convenient folder when I start it?

18条回答
  •  感情败类
    2020-11-28 02:09

    Git bash is used to play with bash commands. So I use bash method itself in windows Git bash

    Edit your .bash_profile (create it if you doesnot have one - see below how to create). Enter the following lines.

    Add these lines to the file

    alias ws="cd /d/workspace/"
    ws
    

    My .bash_profile looks like this

    Smilyface@SmilingMachine /d/workspace
    $ cat ~/.bash_profile
    alias ws="cd /d/workspace/"
    ws
    

    How to create a new .bash_profile ?

    touch ~/.bash_profile
    

    OR write into the file directly

    vi ~/.bash_profile 
    

    Simple, aha !

提交回复
热议问题