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.

  • SSL certificate rejected trying to access GitHub over HTTPS behind firewall
  • How to make git push work with Cygwin?
  • Cygwin or Git Bash command window?
  • Updating file permissions with git-bash on Windows 7
  • Cygwin/Git error cygheap base mismatch detected
  • Cygwin gitk issue
  • 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.

  • Where are the Git branches stored?
  • git: how to turn a clone into a new branch?
  • Merge/rebase a 'disconnected' branch in Git
  • Is there an automatic way to deduplicate .gitignore rules?
  • Git - only push up the most recent commit to github
  • create version.txt file in project dir via build.gradle task
  • 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.