Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Push To Remote Server Hangs Using Cygwin

I'm new to git via the command line and have run into a bit of trouble I haven't been able to pull myself out of.

I've set up a repository on my server and have created a local directory using the directions at thelucid.com.

on server:

ssh [email protected]
mkdir my_project.git
cd my_project.git
git init --bare
git update-server-info # If planning to serve via HTTP
exit

then, on local machine:

cd my_project
git init
git add *
git commit -m "My initial commit message"
git remote add origin [email protected]:my_project.git
git push -u origin master

When I get to the final command here "git push -u origin master" the command hangs and hangs and never stops hanging.

git status on local gives me this:

$ git status
On branch master
nothing to commit, working directory clean

git status on the server (inside myproject.git/)gives me:

$ git status
fatal: This operation must be run in a work tree

I'm not exactly sure where to look next, I've tried a bunch of things, but my ignorance is mountainous and I could use a guide; maybe a wizard, some dwarves, and hobbit if you have any spares. Any help would be greatly appreciated.

I'm on windows 8.1. Using Cygwin

Thanks.

like image 585
iethatis Avatar asked Oct 20 '22 13:10

iethatis


1 Answers

If you are using Windows, msysgit is a better option. Using git push in Cygwin is known to have issues. The gist of it is that Git by default, tries to use a "simple password prompt" as part of its user authentication process, as mentioned in the git-config doc(search for core.askpass). This password prompt, however, only works on real UNIX, but not on Cygwin. If interested, you can read about the history of this issue here.

If you absolutely have to use Cygwin, then make sure you installed the Cygwin git packages as specified here. Then try run this command:

$ git config --global core.askpass /usr/libexec/git-core/git-gui--askpass

There are probably other more involved solutions out there, but I think the simplest solution is still to install msysgit. :-)

like image 116
ivan.sim Avatar answered Oct 22 '22 23:10

ivan.sim