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

后端 未结 18 1004
暗喜
暗喜 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条回答
  •  -上瘾入骨i
    2020-11-28 02:05

    I read it somewhere and it worked for me.

    First check in git bash what is the HOME location. Open git bash and run

    echo $HOME
    

    Now change the HOME path by opening cmd and run

    setx HOME "path/to/.ssh/loc" (I gave C:\Users\aXXXX)
    

    Now cross check by running the echo command in git bash.

提交回复
热议问题