Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble pushing to Github, cannot spawn sh: No such file or directory

Tags:

git

github

I'm having a difficult time pushing to Github..I have a repository that I had cloned, and I have made changes to it that I'd like to push back to github.

While in the repository, I do the following:

git add *

Which seems to work as I get no response, then when I do:

git commit -m "test"

I get the response:

On branch Will_branch
nothing to commit, working directory clean

which I expect is where my problem starts.

When I do:

git push origin master
git push origin my_branch

I get the error:

cannot spawn sh: No such file or directory
cannot spawn git: No such file or directory

I have gone through so many guides to no avail..thanks for any help.

like image 533
Will Nasby Avatar asked Mar 24 '14 19:03

Will Nasby


1 Answers

This might be happening due to a large number of tags in your repo. Check this google-group entry, this question and another google group entry.

Basically, this is a known issue with msysgit and users on google group suggest using the ssh protocol instead as workaround:

  1. Uninstall Git (this doesn't uninstall your existing repositories or SSH keys you've generated)
  2. Reinstall git at C:\Git
  3. Open git bash
  4. run this command: export GIT_SSH=/c/Git/bin/ssh.exe

Also, the commit response you are getting suggests nothing got committed, do a git log to check if the commit actually happened.


Another reason, as mentioned in this msysgit ticket could be the presence of spaces in your Environment variables. Moving the installation of msysgit etc to C: instead of C:\Program Files may solve it.

like image 145
Anshul Goyal Avatar answered Nov 10 '22 05:11

Anshul Goyal