Github: Unable to git push since atom v1.21.0

Created on 4 Oct 2017  ยท  14Comments  ยท  Source: atom/github

Prerequisites

Description

Since v1.21.0 I get an error when I try to push my commits via the git window in atom.

error: cannot spawn .git/hooks/pre-push: No such file or directory
error: waitpid for .git/hooks/pre-push failed: No child processes
error: failed to push some refs to 'https://[url]/[project].git'

v1.22.0-beta0 has the same issue.

My project uses LFS to store some media files.

Steps to Reproduce

  1. Stage changes and create a commit
  2. Click on Push

Expected behavior: It should push commits to remote without errors.

Actual behavior: The above error appears.

Reproduces how often: Always since v1.21.0

Previous versions are not affected.

Versions

Atom : 1.21.0
Electron: 1.6.9
Chrome : 56.0.2924.87
Node : 7.4.0
OS: Windows 10 x64

Most helpful comment

@rsese You were right! It was a PATH issue. For some reason, my git entry in PATH on my office PC was pointing to C:\Program Files\Git\cmd. Seems like older git installations created this entry in PATH but newer installations did not update it to C:\Program Files\Git\bin.

Even uninstalling and reinstalling git did not fix the PATH issue.

Manually changing C:\Program Files\Git\cmd to C:\Program Files\Git\bin solved my problem. ๐Ÿ‘

Thanks for all the help. ๐Ÿ˜„

All 14 comments

Does .git/hooks/pre-push exist within your repository?

If it does, I wonder if this is similar to atom/github#1169, where git is trying to execute a shell script but sh.exe isn't on the %PATH%.

Yes, .git/hooks/pre-push exists in my repository.

Atom versions prior to v1.21.0 pushed fine. I downgraded to v1.20.1 so I can continue pushing without having to open another cmd window.

this ticket seems a duplicate of same bug since beta https://github.com/atom/github/issues/1184

I dont understand this ticket(what its meant by push), There is only a commit button and that cant be used to commit anything larger than a file or two, if it has a couple of files and a folder with some tiny pngs. Pushing the commit button just hangs there thinking about the meaning of life or whatever...

Over command line its instant.

Prerequisites

$ atom -v

Atom    : 1.21.0  
Electron: 1.6.9  
Chrome  : 56.0.2924.87  
Node    : 7.4.0  

$  apm -v

apm  1.18.5  
npm  3.10.10  
node 6.9.5 x64  
python 3.5.2  
git 2.14.2.windows.1  
visual studio

When I click "Push" it asks for login credentials but nothing comes up for me to enter a commit message and nothing changes in the online repo, the file also stays orange(meaning its not been committed but has changed)

What's happening here?

Still happening in atom v1.24.0.

This issue is still happening in atom v1.26.0-beta0. #NeverFix

Seriously guys, this issue hasn't been fixed for more than 5 months now. The error is still the same as described in the issue description.

Ignore the comments that mention other issues. I checked them and they are all not related to this issue!

This issue only happens when I use LFS on a project and try to push commits using atom. The file .git/hooks/pre-push exists and pushing via the command line works as expected.

@rsese Would you mind looking into this?

I hope I tagged the right guy ๐Ÿ˜„

I can take a look to at least try and reproduce on Windows with a repo using LFS.

Finally had a chance to give this a try and was unable to reproduce on Windows 10 with a repository using LFS (which looks like it creates a pre-push hook so my test repository had that too).

It sounds like this happens with any project of yours that uses LFS?

Do any hooks generate a similar error? E.g. if you just have a non-LFS test repo and add a post-commit hook that just creates a file, does that work or do you get the same error - I tried with a test repo by creating .git/hooks/post-commit with just:

#!/bin/sh

touch test.dat

And then the file gets created after committing with the GitHub package.

pushing via the command line works as expected

Just curious, do you have Git Bash installed or something else?

We're using our own GitLab server. I just created a test project with LFS and was unable to push directly on the first initial commit. I wasn't even able to use the stage all feature, I had to go into cmd and enter git add . before I was able to create a commit in atom.

atom_2018-03-29_10-02-19

I'll try to recreate this on GitHub, give me a moment.

Edit: I don't have Git Bash installed and I'm not using it. I'm using Git for Windows v2.16.3 with the default Windows cmd integration. On Windows 10 I still use the old cmd, not PowerShell.

Ok I got the same error on GitHub.

atom_2018-03-29_10-18-54

Fork this project:
https://github.com/HitomiTenshi/Test-LFS.git

Change something in test.txt.

Then commit and push and you'll get the error.

Had a chance to test on Atom 1.25 on Windows 10 and pushing worked ok with my fork:

https://github.com/rsese/test-lfs

So the problem doesn't look like it affects everyone but there's something maybe related to your setup? Not sure what that would be though - looking at the issue @smashwilson pointed to as possibly similar, if you temporarily modify your PATH to include sh.exe from your Git for Windows installation (sorry, I referred to that as Git Bash before), does that make any difference?

Looks like it's at C:\Program Files\Git\bin on my machine.

Hmm seems to be some very strange issue with the PC in my office. I'm currently on vacation, so I can't test if adding sh.exe to the PATH fixes it. I'll test it once I'm back.

In the meantime I tested the LFS issue with my Notebook. Seems like my Notebook does not have this issue.

The PC in my office is somewhat old, it was setup back when Windows 10 was freshly released. I kept git for windows up to date on it though! (with the LFS option in the installer) I'll post another comment once I tested the PATH thing on my office PC.

Thanks for assisting me with my issue @rsese, greatly appreciated!

@rsese You were right! It was a PATH issue. For some reason, my git entry in PATH on my office PC was pointing to C:\Program Files\Git\cmd. Seems like older git installations created this entry in PATH but newer installations did not update it to C:\Program Files\Git\bin.

Even uninstalling and reinstalling git did not fix the PATH issue.

Manually changing C:\Program Files\Git\cmd to C:\Program Files\Git\bin solved my problem. ๐Ÿ‘

Thanks for all the help. ๐Ÿ˜„

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesChevalier picture JamesChevalier  ยท  4Comments

RafaelNGP picture RafaelNGP  ยท  4Comments

Hreacon picture Hreacon  ยท  3Comments

benogle picture benogle  ยท  4Comments

ccavolt picture ccavolt  ยท  3Comments