Programmatically (not manually) finding the path where Git is installed on a Windows system

前端 未结 6 743
太阳男子
太阳男子 2020-12-13 06:12

I\'d like to write a small build helper tool that shall read some properties of the current Git working directory, like the last commit hash, whether there\'s modified files

6条回答
  •  春和景丽
    2020-12-13 06:32

    If you are in Windows 8 and above here are the steps that you can follow.

    1. go to your start screen and search for git.exe
    2. In the search result right click on the Git Gui/ Git Bash icon and select Open File location
    3. You will be taken to a flder where the shortcuts will be located. Right click on the shortcut nd select properties
    4. the file location can be found in the Target field

    For me it was "C:\Users\\AppData\Local\Programs\Git\cmd\git-gui.exe"

    Hope it helps

提交回复
热议问题