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

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

    Just type the path of your local directory (Git project home directory) in the properties of Git Bash. I.e. set path C:\yourprojsctdirectory to Git Bash's properties field "Execute In" or (Ausführen in). That's it!

    Now double click Git Bash. The Git header will be on your "yourprojsctdirectory".

    0 讨论(0)
  • 2020-11-28 02:02

    Right click on Git Bash shortcutand then go to properties.
    In properties inside start in option add the location of the directory you want to start Git Bash in and apply the changes.

    0 讨论(0)
  • 2020-11-28 02:02

    Add "cd your_repos_path" to your Git profile, which is under the %.

    0 讨论(0)
  • 2020-11-28 02:02

    the only way that worked for me on windows 10:

    1. right-click gitbash shortcut -> proporties
    2. change target as: "C:\Program Files\Git\git-bash.exe" --cd=C:\Users\test\Desktop\

    This will always open desktop path

    0 讨论(0)
  • 2020-11-28 02:03

    After installing msysgit I have the Git Bash here option in the context menu in Windows Explorer. So I just simply navigate to the directory and then open Bash right there.

    I also copied the default Git Bash shortcut to the desktop and edited its Start in property to point to my project directory. It works flawlessly.

    Windows 7x64, msysgit.

    0 讨论(0)
  • 2020-11-28 02:03

    Open the properties of the bash and change to "Start in" to where you want to start in. After this, (I had this problem and I solved it by doing this) go to target and delete the --cd-to-home parameter part after "C:\Program Files\Git\git-bash.exe" . Only THEN will you start in the "Start in" directory that you specified.

    0 讨论(0)
提交回复
热议问题