How to install Git Shell

前端 未结 6 1115
执念已碎
执念已碎 2020-12-23 17:17

Windows 7 Ultimate

I used to have Git Shell installed. The icon is grey with a cat face. It was either installed by the Git or by GitHub for Windows.

Somehow

相关标签:
6条回答
  • 2020-12-23 17:24

    If you have GitHub for Windows (installed, it should come with your shortcut.

    It is a shortcut to:

    C:\Users\Username\AppData\Local\GitHub\GitHub.appref-ms --open-shell
    

    More recent versions of G4W (see answer below) could have it at:

    %LOCALAPPDATA%\Apps\2.0\...\...\
    C:\Users\Username\AppData\Local\Apps\2.0\GitHub\GitHub.appref-ms --open-shell
    

    If that shell complains about the absence of git, launch "G4W" itself, which will extract git.
    See "Where is git.exe located?".

    As mentioned below, to restore the shortcut, after having run the first command, execute in the Git shell:

    github --reinstall-shortcuts
    
    0 讨论(0)
  • 2020-12-23 17:28

    I found out that the answer that you specifically wanted involves a combination of the previous answers: 1. Running the Git Shell via the command line (Since you lost the shortcut)

    C:\Users\Username\AppData\Local\GitHub\GitHub.appref-ms --open-shell
    

    2. Once youre in the Git Shell run the command in the previous answer

    github --reinstall-shortcuts
    

    You'll find the Git Shell with the grey cat icon that originally came with the GitHub setup in the desktop.

    0 讨论(0)
  • 2020-12-23 17:30

    Try running the following command:

    github --reinstall-shortcuts

    That repaired the Git Shell shortcut for me, and also put the proper icon back.

    0 讨论(0)
  • 2020-12-23 17:43

    I ran into this same issue today, and since this is the first Google result for my query trying to find a solution, I'll post what I sorted here.

    It looks like GitHub for Windows installs some or all of itself into %LOCALAPPDATA%\Apps\2.0\...\...\* and this reference was broken on Git Shell .lnk shortcut on the desktop. The GitHub.exe file pointed to did not exist; the entire path was missing.

    I viewed properties on the .lnk file (select Properties from context menu or ALT+ENTER on keyboard with .lnk selected) and clicked the Change Icon button. A message box appeared noting that the path to the old icon file was missing and what the bad path was.

    I found the "current" path by poking about in the above noted directory and finding GitHub.exe again. The icon is one of three available in GitHub.exe; I expect this is what some of the other answers (like the reinstall-shortcuts suggestion) accomplish.

    Hope this helps someone!

    • (Which seems to be normal for .NET ClickOnce applications; those ... are randomized/obfuscated/generated so they will look like gibberish. My specific working path, as an example, ended up being: C:\Users\anshou\AppData\Local\Apps\2.0\RZ33EP02.2J7\5OMOZAGM.89T\gith..tion_317444273a93ac29_0001.0003_e68db37a99107794 -- note that this path is not truncated, that is the exact path, double period and all.)
    0 讨论(0)
  • 2020-12-23 17:44

    The direct link for Git Shell is now:

    https://git-scm.com/downloads

    0 讨论(0)
  • 2020-12-23 17:46

    Windows 10
    Git-2.19.0-64

    The Git Shell is installed by default in:

    C:\Program Files\Git\git-bash.exe
    

    Try create a shortcut to your desktop, not sure if this answer your question.

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