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 git@example.com
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 git@example.com: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.

  • Git : remove totally nonexistent file from… well… from I don't know where
  • Organize LabVIEW in a git repository
  • How to set TERM environment variable in Windows so that it works with Bash via SSH and locally with Git?
  • How to push git from php using exec()
  • How to handle files committed to Git on Linux with invalid Windows filenames?
  • How can I set up gVim as my editor on Git for Windows?
  • Can I use mSysGit and Cygwin's git?
  • Tortoise GIT: go back to previous version
  • 2 Solutions collect form web for “Git Push To Remote Server Hangs Using Cygwin”

    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. 🙂

    The problem is that you are inside the .git folder.
    you need to be in the root folder (the parent of .git) to be able to view the status and then push all your changes.

    cd..
    git status
    
    Git Baby is a git and github fan, let's start git clone.