bertday
bertday

Reputation: 10971

Chocolatey - Git installs, but is not on the PATH

I'm using Chocolatey (v0.9.8.27) as a package manager for Windows. I've installed multiple packages, and they all run fine, but for some reason Git isn't working.

The command I used was choco install git. It downloads git and git.install to the lib folder, and says that the install finished successfully, but nothing ends up in the bin folder. When I try to start Git, I get an error about it not being a recognized command.

My first thought was to check my environment variables, but I don't even see any executables to point to. Has anyone else come across this before?

Upvotes: 32

Views: 24242

Answers (5)

Giulio Caccin
Giulio Caccin

Reputation: 3052

If you don't want to force a specific version:

Use --force (-f) on the installation behavior on the git.install package.

In this example, I've also added --confirm (-y) and --debug (-d) options to make things more visible:

    choco install git.install -yfd

https://chocolatey.org/docs/commands-install

Please also check if you have administrative access requirements and that you have all windows permissions. Manual delete of previous installation files might help.

Upvotes: 7

Matt Owens
Matt Owens

Reputation: 49

Try typing "git.exe". That was properly mapped for me.

If you are using choco and PowerShell, this package allows you to call Git commands directly without the ".exe" file extension:

choco install poshgit

You can also use this command in PowerShell to list your environment variables:

(Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' -Name Path).Path

Upvotes: 1

ellriley
ellriley

Reputation: 655

None of the other answers worked for me - I had to delete both the C:\ProgramData\chocolatey\lib\git and C:\ProgramData\chocolatey\lib\git.install directories, and then run choco install git again.

In case it helps anyone else, I think my problem resulted because I had installed Git manually before installing it with Chocolatey. Unfortunately, that resulted in neither being on my path. I uninstalled the one in Programs and Features, and did choco install git -force -debug, hoping that the Chocolatey version would take over, but although I had no errors, there was still no Git on path, and no Git exe to be found.

Upvotes: 1

MushinNoShin
MushinNoShin

Reputation: 4886

Some folks might be running into this currently as there's an issue with the current version (1.9.5.20150319) of the git.install package.

This can be gotten around by installing the previous version with:

choco install git.install -version 1.9.5.20150114

Upvotes: 19

Gary Ewan Park
Gary Ewan Park

Reputation: 18981

I recently installed Git on my work laptop using Chocolatey, and it worked fine.

Can you mention which version of Chocolatey you are using? Since Chocolatey is just a wrapper around the Git installation package, all it is doing is running the MSI/EXE in the same way that you would do it manually. To that end, you should find the Git files here:

C:\Program Files (x86)\Git\bin

And either the MSI/EXE will have added this onto your path variable (I can't remember which one does it), so that you can run it from the command line using just "git".

If this folder doesn't exist, then yeah, something went wrong with the installation. To try to correct this try running:

choco install git -force -debug

And if there are any types of warning/errors displayed I would suggest that you get in touch directly with the package maintainer (in this case it is Rob himself) using the link on the Package page on Chocolatey.org

Upvotes: 5

Related Questions