Wondering how to fix this problem in Windows ?
When i try and use the command \"git push origin master\" I get
git-receive-pack: command not
You need to add the bin folder path where git was installed to the PATHS of the Windows System Environment variables. But if you have installed git using a 64-bit installer the path is different:
C:\Program Files\Git\mingw64\bin
notice the sub path "mingw64".
I had a similar problem when trying to execute a git pull from another Win-7 machine. Here's what I did:
Git directories to add (so far):
..\git\bin, ..\git\libexec\git-core, ..\git\cmd
To modify the Windows-7 path, use the following:
Click Start, then right-click on "Computer" and select "Properties", On the left panel, select "Advanced system settings", In the System Properties dialog, click on the "Environmental Variables…" button, Select "Path" from the "System variables list", and click the "Edit" button
Add the needed paths to the end of the existing Path string using a semi-colon as the delimiter. Note: the path needs to be specified from the disk root (e.g. C:).
I had this problem when I mistakenly tried to git clone
a repo that was actually a Mercurial
repo. Someone else created the project and I'd never used Mercurial before.
Felt like an idiot, but I couldn't find any answers on SO that fixed it. Whoops!
From Git FAQ:
Basically the problem is that 'git-receive-pack' is not in the default $PATH on the remote end.
You can see the problem using a DOS window:
set PATH
(display the path)
type
set PATH=%PATH%;"c:/program files/Git/Bin"
git push origin master
If that solves the problem, you will be better off adding that path in your user environment variables (see this superuser question for instance)
Or a bash Git shell:
$ export PATH=$PATH:"/c/Program Files/Git/bin"
$ git push origin master
Check also your .bashrc
in your $HOME path ('echo $HOME
' within a bash session; add the export line in it, or simply '~/.bashrc
')
Note: a classic msysgit installation should have taken care of those path.