Search code examples
gitwindows-7githubmsysgit

Git push origin master returns Error cannot spawn ... why?


I'm trying to use GitHub for the first time, but after many issues trying to get the authentication right, I've managed to authenticate with git@github.com and created a repo, but when i try "git push origin master" i get the following error:

$ git push origin master
error: cannot spawn : No such file or directory
fatal: unable to fork

I cant find any reason for the error or any explanation in the trouble shooting pages, can anyone suggest why it may be that I get that error.

I have already specified/added the remote path as follows:

$ git remote add origin git@github.com:christopherdebeer/yUML-Diagram.git

please help.

Also this is all on a windows 7 machine running mysysgit (1.7.0.2) and using git bash.

re: Issue 313, a space in the GIT_SSH variable, cant be the problem mine is as follows:

$GIT_SSH="c:/putty/plink.exe"

Solution

  • I'm not sure if it was just stupid of myself, but I've solved the problem... Here's what I did (from advice, from work colleagues):

    I was attempting to push changes in a local repo to an empty repo on github...

    what i should have done was clone the empty repo, add the files locally to my cloned repo, added the files, commited the adds, and THEN push to the github repo...

    $ git clone git@github.com:christopherdebeer/yUML-Diagram.git
     // added files
    $ git add *
    $ git commit -m "first commit locally"
    $ git push origin master
    

    My original problems might have been due to my totaly naivety as to gits usage...