Git Push to Remote Server Hangs Using Cygwin

I am new to git through the command line and ran into small issues that prevented me from pulling myself out.

I installed the repository on my server and created a local directory using thelucid.com instructions.

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 the 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 is "git push -u origin master", the command freezes and freezes and never stops hanging.

git status on local gives me the following:

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

The 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 quite sure where to look further, I tried a bunch of things, but my ignorance is mountainous, and I could use a guide; maybe a wizard, some dwarves and a hobbit if you have spare parts. Any help would be greatly appreciated.

I'm on windows 8.1. Using Cygwin

Thanks.

+6
source share
2 answers

If you use Windows, the best option is msysgit . It is known that using git push in Cygwin has problems. Its essence is that Git by default tries to use a "simple password hint" as part of the user authentication process, as specified in the git-config doc (search for core.askpass ). However, this password hint only works on real UNIX, but not on Cygwin. If interested, you can read about the history of this issue here .

If you absolutely must use Cygwin, make sure you install Cygwin Git packages as indicated here . Then try running this command:

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

There are probably other more complex solutions, but I think the easiest solution is still to install msysgit. :-)

+5
source

The problem is that you are in the .git folder. you must be in the root folder (parent .git) in order to be able to view the state and then push all your changes.

 cd.. git status 
-2
source

Source: https://habr.com/ru/post/985563/


All Articles