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

后端 未结 18 1023
暗喜
暗喜 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:11

    I am using Git bash on Windows 10, here is my solution:

    1. Close all git bash sessions
    2. Hit windows key and type: env; then click Edit environment variables for your account (control panel)
    3. Under "User variables for ...."; hit New button
    4. Variable Name: HOME
    5. Variable value: path where you would like ~/ to be in git bash

    Open a git bash session and test it by typing: pwd and double check by doing cd ~/ && pwd

提交回复
热议问题