4

I set up gitosis but even when i can clone, pull and push to the gitosis-admin repo, i can't create new ones.

According to every doc i read, to create a new repo one has to:

  • Give user write access to the repo (inside a group put: writable = repo-name)
  • The user create a repo locally add a remote then does a push
  • The repo is created in the server

But i always get the error fatal: 'repo-name.git' does not appear to be a git repository

But if a login on the server (as user git) and create the repo manually using mkdir repo-name.git && cd repo-name.git && git --bare init, then i can push from my local repo to the remote one.

Zombo
  • 1
  • 62
  • 391
  • 407
Cesar
  • 4,076
  • 8
  • 44
  • 68
  • When you say "i always get the error `fatal: 'repo' does not appear to be a git repository`", when does this error occur? When creating the repo locally or when pushing the local repo to the gitosis server? What it the exact error? – Tim Henigan Oct 29 '09 at 16:03
  • When pushing the local repo to gitosis. The error is (something like): 'repo-name.git' does not appear to be a git repository The remote end hung. But i suspect is a damage installation because in ubuntu 9.04 it's working good. And in OS X 10.5.8 and ubuntu 8.10 not – Cesar Oct 29 '09 at 20:03
  • 3
    Gitosis is no longer supported. You should consider switching to gitolite. – wadesworld Jun 14 '12 at 11:58

3 Answers3

1

I was having this problem and I found out if I change the way I access the repository, it worked. After you have created the group writeable.

# Go to the directory you want to start your project in.
git init; git add .
git commit -m 'initial commit'
git remote add origin gitosis@[server]:gitosis-test.git
git push --all

So to recap before I was doing gitosis@[server]/gitosis-test.git and that was failing. I swapped the semicolon and it worked.

Props on the loglevel = DEBUG It helped a lot to find out what was happening.

Zombo
  • 1
  • 62
  • 391
  • 407
Atherion
  • 584
  • 1
  • 5
  • 14
0

UPDATE:
In your gitosis-admin repo, try adding loglevel = DEBUG under [gitosis] in your gitosis.conf. Push this change to your server and then try again. This will generate a lot of useful information to help debug the problem.

These instructions from Dreamhost are the best I found.

Are you pushing the gitosis-admin repo after updating permissions?

Tim Henigan
  • 60,452
  • 11
  • 85
  • 78
  • Yes, and it's updating the config in the gitosis server, I've also made sure the post-update hook was executable... – Cesar Oct 29 '09 at 03:46
  • 1
    What I don't know is if gitosis should make the new repo when it's configuration is updated, I mean, I update the config and push, I see the config is updated on the server BUT i don't see the new bare repo created, but i don't know if this is the way is supposed to work? – Cesar Oct 29 '09 at 03:50
  • @Cesar: Simply updating the configuration in `gitosis.conf` does not create the repository on the server. To do that, you must create the repo locally and then push it to the server using `git push origin master:refs/heads/master`. – Tim Henigan Oct 29 '09 at 16:16
  • but actually, git push origin master:refs/heads/master didn't work at all. – xiao 啸 Dec 03 '10 at 14:45
0

Hello i've had exactly the same problem just today.

I checked by

$ ssh git@yourserver echo if you see this, it is not gitosis

and found out that gitosis was not servicing ssh sessions.

I couldnt get why.

As a solution a deleted git user (that i used for gitosis purposes) with its home folder and recreated it from scratch.

And it helped.

README.rst from gitosis.git says

".. warning::

    For now, ``gitosis`` uses the ``HOME`` environment variable to
    locate where to write its files. If you use ``sudo -u``
    without ``-H``, ``sudo`` will leave the old value of ``HOME``
    in place, and this will cause trouble. There will be a
    workaround for that later on, but for now, always remember to
    use ``-H`` if you're sudoing to the account.

You should always edit the configuration file via git. The file symlinked to ~/.gitosis.conf on the server will be overwritten when pushing changes to the gitosis-admin.git repository. " i suppose it might be the cause..

Alex
  • 837
  • 8
  • 9