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

  • Git pull cygwin not a git-command
  • Why is the Git Plugin for Jenkins rewriting my local git repo url with extra slashes?
  • why git svn clone failed when using cygwin?
  • Temp file with moniker 'svn_delta' already in use at /usr/lib/perl5/vendor_perl/5.14/ line 1024
  • SSH Private Key Permissions using Git GUI or ssh-keygen are too open
  • Unable to push to git Repository. It hangs after “Writing Objects: 100%”
  • on server:

    mkdir my_project.git
    cd my_project.git
    git init --bare
    git update-server-info # If planning to serve via HTTP

    then, on local machine:

    cd my_project
    git init
    git add *
    git commit -m "My initial commit message"
    git remote add origin
    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


  • What happens when a GIT submodule goes 'offline'?
  • How to cherry-pick changes from one file to another file?
  • Commit to multiple branches at the same time with git
  • Git's local repository and remote repository — confusing concepts
  • Git: how to check out the currently pushed branch in the pre-push hook?
  • Pushing single changes using phpstorm / git repository
  • 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.

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