English 中文(简体)
Cygwin/Git/Gitosis unable to push new repository
原标题:

I ve recently set up cygwin, git, and gitosis on my Windows Server 2003 box and am having troubles. I ve followed just about every tutorial I can find to the letter, and have confirmed that my git account s authorized_keys table is getting updated when I push the gitosis-admin repository. I seem to be stuck, however, when it comes to creating a new repository.

I ve seen many tutorials that recommend the following code (obviously the repo name changes), tried in both git bash and windows command line:

mkdir free_monkey
cd free_monkey
git init
touch README
git add .
git commit -m "Added blank readme"
git remote add origin git@my_server:free_monkey.git
git push origin master

When I execute the last line (no matter exactly what I send), it says "The remote end hung up unexpectedly": $ git push -v origin master:refs/heads/master Pushing to git@my_server:free_monkey.git fatal: The remote end hung up unexpectedly

My gitosis.conf file looks like the following:

[gitosis]
loglevel = DEBUG

[group gitosis-admin]
writable = gitosis-admin free_monkey.git free_monkey
members = git@my_server @all

Please let me know if I m missing any information you need to help me debug this. Thank you!

One other thing that concerns me:

$ ssh git@my_server git 
DEBUG:gitosis.serve.main:Got command  git  
ERROR:gitosis.serve.main:Unknown command denied 

Is that maybe the problem? If so, how do I fix that?

最佳回答

OK, so, it seems that the "Unknown command denied" error was a red herring. Gitosis only allows for the commands that actually get sent across during a git push/pull process for security reasons, so "git" was not a known command.

I continued receiving the same error, but stumbled-upon a reference to the authorized_keys file in another forum - having duplicate keys ruins the authorized_keys file completely. Sure enough, that was my problem. Hope this helps someone out there.

To really diagnose this, follow these steps:

  1. cat your authorized_keys files for the user you re using to access your git repositories (mine was git@my_server, so I looked in /home/git/.ssh/authorized_keys). Make sure you have each public key only once.
  2. I ran into a second problem, which was that I was trying to use multiple ppk s with TortoiseGit and Pageant. Pageant seems to ignore TortoiseGit s request to change keys; right click on Pageant in your taskbar (the computer wearing a hat) and View Keys, then remove all keys that don t match the public key you want to use (could be all of them).

I now have gitosis running on my server available over SSH, accessible via TortoiseGit.

问题回答

You probably made a typo on the first time or something. Try removing the origin and re-adding it:

git rm origin
git remote add origin git@my_server:free_monkey.git

Then try pushing again. It s worth a try.





相关问题
cygwin file path tab completion not working

How can I set up Cygwin to have tab completion? Actually, I do have it automatically, but it does not seem to complete paths. How do I set it up to complete paths?

cygwin version of idle has erroneous I/O handling

I am using idle (python 2.5) via cygwin on a windows vista machine and when I try to open an already existing .py file I see the full file path /home/aaron/C:/cygwin/home/aaron/script.py on the ...

Trying to get a terminal to work in Emacs

I ve been having a lot of problems with emacs and trying to get the terminal to work with: M-x term I installed cygwin and I fixed up my .emacs to include the paths: (setenv "PATH" (concat "...

Piping Cygwin into a Python program

As a i m new to the whole Piping thing and Python I had recently encountered a problem trying to pipe Cygwin s stdin & stdout into a python program usin Python s subprocess moudle. for example I ...

Unable to chdir() on Git/Cygwin

I installed Git via Cygwin on Windows Server. It works out very well. However there s a small issue that when I clone a repo use the command as following: $git clone git@myserver:project.git I ...

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7. I am looking for seting-up a ...

Cygwin/Git/Gitosis unable to push new repository

I ve recently set up cygwin, git, and gitosis on my Windows Server 2003 box and am having troubles. I ve followed just about every tutorial I can find to the letter, and have confirmed that my git ...

热门标签