How to change git shell's start directory in windows 7

前端 未结 6 1861
鱼传尺愫
鱼传尺愫 2021-02-05 01:10

I downloaded and installed the programs offered by GitHub including Git Shell.

The problem is that I want to set up the home directory of the Git Shell program to a cust

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-05 01:33

    According the article below (in the "Posh-Git and PowerShell" section) you should be able to create a Documents\WindowsPowerShell\GitHub.PowerShell_profile.ps1 file that will start when your GitHub PowerShell starts. In that file you can add the Set-Location c:\path\to\repo command.

    For what it's worth, in case anyone comes across this but has a Bash shell, adding the command cd /path/to/repo to ~/.basrc should do the trick.

    http://haacked.com/archive/2012/05/21/introducing-github-for-windows.aspx

提交回复
热议问题