views:

65

answers:

2

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 [email protected] 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 [email protected]: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"
+1  A: 

That reminds me of issue 313, where GIT_SSH environment variable contains spaces in its path.

Other than that, did you followed the GitHub Help page and checking if your ssh connection worked?

$ ssh [email protected]
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
ERROR: Hi tekkub! You've successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.
VonC
Yeah ive definitely checked that my ssh works correctly. as per the GitHub help page, and gotten the mesage:"Hi christopherdebeer! You've successfully authenticated but GitHub does not provide shell access"I'll look into "issue 313"...
Christopher
Nope its is definitly not issue 313, my $GIT_SSH is set to "c:/putty/plink.exe"
Christopher
@Christopher: How about not using `GIT_SSH` and plink.exe at all? I don't (on my Windows7 msysgit installation) and push just fine. What version of msysgit are you using by the way?
VonC
@VonC I'll give it a go, I'm using 1.7.0.2 mysysgit
Christopher
still no luck...
Christopher
@Christopher: Then could you try changing the remote address from a git protocol to an https protocol, taking advantage from the smart http implementation proposed by GitHub? See http://stackoverflow.com/questions/2949128/git-push-problem-argh/2949418#2949418
VonC
+1  A: 

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 [email protected]: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...

Christopher
Strange, since you shouldn't be able to clone an empty repo: http://stackoverflow.com/questions/1298190/gitosis-and-git-clone-problem/1298224#1298224 and http://stackoverflow.com/questions/895819/whats-the-most-straightforward-way-to-clone-an-empty-bare-git-repository/895828#895828. See also http://support.github.com/discussions/repos/150-cannot-clone-an-empty-repo
VonC
The advice that i recieved from a work colleague, (he doesnt use git at all, but does svn) ... when i mentioned my issues he recommended cloning the empty repo... as though it were common practice (if not for svn) then for him at least.
Christopher
which is weird that you say it isnt possible... because it Definitly worked for me.
Christopher
@VonC: Git 1.6.2 and later can “clone” empty repositories (i.e. setup the remote and a local master branch that will, eventually, track the remote master branch).
Chris Johnsen
@Chris: very true. I need to update those old answers ;)
VonC