git-receive-pack: command not found in Windows

后端 未结 4 1461
忘掉有多难
忘掉有多难 2021-01-12 08:24

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

4条回答
  •  逝去的感伤
    2021-01-12 09:15

    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.

提交回复
热议问题