41

According to https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

The installer includes a command line version of Git as well as the GUI. It also works well with Powershell, and sets up solid credential caching and sane CRLF settings.

When I'm launching the latest download from https://desktop.github.com/, it just runs immediately and does not offer me to install command line version. I checked in cmd by typing git, command is not recognized.

Do GithubDesktop really installed Git command line, if not can I force it to do so somehow ?

Update: I've found the install but cannot access it from Powershell.

user310291
  • 35,095
  • 76
  • 252
  • 458
  • 2
    Note that GitHub team does not recommend using the embedded git executable in place of installing from https://gitforwindows.org/. Reasons here: https://github.com/desktop/desktop/issues/3708#issuecomment-354665183 – aaronsteers May 03 '19 at 22:48

7 Answers7

38

On Windows the latest Electron / unified versions of github desktop has git stored here:

C:\Users\UserName\AppData\Local\GitHubDesktop\app-1.0.5\resources\app\git\cmd\git.exe
Stephen Rauch
  • 44,696
  • 30
  • 102
  • 125
Pondersome
  • 389
  • 1
  • 3
  • 2
  • There should be a GIT BASH icon somewhere, with a cat, which you run the git commands in. Try https://git-for-windows.github.io/ it is very user friendly and maybe you can figure out what is going on with this installation in the process. – capser Oct 27 '17 at 02:43
17

GitHub Desktop team member here

Do GithubDesktop really installed Git command line, if not can I force it to do so somehow ?

We no longer support the "Git Shell" environment you might be thinking of, as we decided to focus our resources on the GUI experience. You can read the discussion and why we decided to drop support here: https://github.com/desktop/desktop/issues/340

If you want a command line Git experience on Windows, Git for Windows is your best bet.

Brendan Forster
  • 2,337
  • 1
  • 20
  • 31
  • 4
    You should really update your website then. It still advertises that Github Desktop installs git for you. Also you still have a setting in Options > Advanced that lets you select your shell, which doesn't actually do anything. – Ryan Wilson Dec 05 '19 at 22:24
  • I'm happy to find those links and get things updated - can you share them? And if you've encountered a problem with the shell integration please report it to the project so we can investigate: https://github.com/desktop/desktop – Brendan Forster Dec 06 '19 at 09:43
  • At the bottom of the main page here https://desktop.github.com/ it mentions shell integrations. The page doesn't mention that it doesn't install git for you and the wording implies this is the only thing needed. – Ryan Wilson Dec 06 '19 at 21:19
  • The information about SSH keys is also out of date if this is no longer provided with the Desktop tool https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent – Will Ayd Jan 02 '20 at 15:24
  • I am reinstalling my workstation and just figured this out... very sad :( – Gabrielius Feb 02 '22 at 11:34
  • 3yrs have passed and the official documentation still misinforms you https://github.com/git-guides/install-git#install-git-using-github-desktop – Alexandru Cristian Feb 21 '22 at 10:43
11

EDIT: Below answer is now outdated. Please see Brendan Forster's answer as to why and a proposed alternative.

GithubDesktop install a Git shell with their desktop application. It seem to be locate in a same directory than their RIA application.

If you have a shortcut created by installer GitHubDesktop you can retrieve the git shell location.

katalin_2003
  • 729
  • 1
  • 14
  • 29
darkomen
  • 4,281
  • 9
  • 35
  • 65
3

If you are looking for the command line version of GIT with powershell and not CMD prompt like I was then this might help you.

Github Desktop was changed from Chocolate-Covered Yaks (newest version 3.3.4.0) to a new native desktop which was redesigned with Electron. (It uses git version 2.11.0.windows.3)

Unfortunately the new Github Desktop does not (yet) include a right click option to start PowerShell, like the old version did.

So if you are stuck with the old Github Desktop Chocolate-Covered Yaks because you like the powershell option and you want to upgrade to a newer version of GIT, then you should look for a folder like this:

Example: C:\Users{Your UserName}\AppData\Local\GitHub\PortableGit_{hex code which changes}\cmd (Example is for windows 7. For windows 10 I believe it is using \bin as folder name instead of \cmd

The folder contains git.exe.

Note this is a DIFFERENT folder placement than the new version of Github Desktop uses, which is why im adding this as an extra answer.

I thought I could just replace git.exe with the newest version of git, but when I do that I get

Git version
"error launching git: The system cannot find the path specified."

What in the end worked for me was to simply delete the git.exe from the PortableGit_{hex code which changes}\cmd folder.

Since I had installed the Git separately in the newest version, it seems to default back to that and I get

Git version
git version 2.17.0.windows.1

Note that if you delete the git.exe, Github Desktop v3.3.4.0 will stop working and the only thing you can use it for is to open the shell. For me thats perfect as I use the new Github Desktop anyways for anything but opening the shell.

I also wanted to change editor. It is NOT enough to just install the new version of git and select notepad as editor. Somehow the powershell opened by the old Github Desktop still had its core.editor set to vim.

I fixed it by typing the following in the power shell:

git config core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

2

Goto Preferences an choose your Git-Shell. Thats it. Under default Shell you can choose between: CMD, Git Bash, Powershell or Custom.

2

git wants to simplify things so if you don't confortable with command line interface then you try git desktop if you want both command line and desktop GUI then install separate git from This URl https://git-scm.com/

  • I know how to install git command line, but according to the documentation I don't have to go all through the hassle if I install Github Desktop because it would do the command line installation for me including for Powershell. That does not seem true as far as I can see. – user310291 Jan 02 '16 at 12:28
  • As noted above, GitHub team does not recommend using the embedded git executable in place of installing from https://gitforwindows.org/. Reasons here: https://github.com/desktop/desktop/issues/3708#issuecomment-354665183 – aaronsteers May 03 '19 at 22:48
1

Indeed, the latest versions of Github Desktop (I use 2.9.6) on Windows 10 no longer enables:

  • The use of a shell command prompt to directly enter command lines
  • Discarded files placed in the Windows Recycle bin. Which kind of sucks if you want to recover discarded stashed changes, for example.

Here is a hack to enable Git on Windows Command Prompt that works seamlessly with Github Desktop, in the case Git was installed along with GitHub desktop. This is inspired from this thread 'git' is not recognized as an internal or external command, but adapted to the case of GitHub Desktop:

  1. Locate the file git.exe, from the latest release of GitHub Desktop. In my case:

    C:\Users\USERNAME\AppData\Local\GitHubDesktop\app-2.9.6\resources\app\git\cmd
    
  2. Find the location of the GitHub bin folder. In my case:

    C:\Users\USERNAME\AppData\Local\GitHubDesktop\bin
    
  3. Copy these two paths—with no slash at the end—and add them to the User Environment Variables of Windows 10, so they become broadly accessible in the Command Prompt. For this:

  4. Search "Environment Variables" in Windows settings.

  5. In system properties click "Environment Variables..." button

  6. In User variables, click "New"

  7. In Edit Environment Variables, paste both paths.

Now the Git.exe linked to GitHub Desktop is available in Windows Command Prompt. All you have to do is navigate in Command Prompt to the folder where your repository is located and start to git it. (You can first type the command git to verify this works; it summarizes available commands).

This hack even works when GitHub Desktop is opened in parallel to deal with the easy stuff.

Jeremy Caney
  • 6,191
  • 35
  • 44
  • 70
Cedrol
  • 31
  • 2