2

I followed the tutorial at http://blog.agdunn.net/?p=277 to setup git and gitosis.

I can clone the gitosis-admin repo edit it and push it to the server. When I look at the files on the server they are the same as my local copies so everything is good there.

The problem comes when I try to create my own repo. In the gitosis.conf file I added the following

[group exampleproject]
writable = myproject
members = ian

Then I did the following on my local machine to create a repo

mkdir myproject
cd myproject

I then created a readme file and commited my changes

git add .
git commit -m 'My first commit of readme file'

Then I added a remote

git remote add myserver git@server_name:/var/git/repositories/myproject.git

Then when I try to push using the following

git push myserver master:refs/heads/master

I get the error messages

fatal: '/var/git/repositories/myproject.git': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly

Can anyone see what I am doing wrong?

Thanks

ianckc
  • 1,716
  • 5
  • 18
  • 33
  • 3
    Not to rain on your parade or anything, but you may wish to consider using gitolite instead of gitosis. – Olipro Jul 18 '11 at 12:12
  • 3
    @Olipro: +1 for gitolite - https://github.com/sitaramc/gitolite – plaes Jul 18 '11 at 12:14
  • I don't see it as raining on my parade at all. I've just tried gitolite and have setup/cloned/pushed repositories with the first hour of using it. +1 for gitolite from me as well. Thanks for the suggestion. – ianckc Jul 18 '11 at 13:03
  • 1
    I really wish whoever quit maintaining gitosis would, as their final act of heroism, say something about that on their website. So many people are still finding gitosis out there with no mention that it's not being actively developed anymore. – Dan Ray Jul 19 '11 at 12:05

1 Answers1

2

Regarding your gitosis command, I suspect you don't need to have the full path for the remote reference for a repo:
In other words, don't:

git remote add myserver git@server_name:/var/git/repositories/myproject.git

But do:

git remote add myserver git@server_name:myproject.git

The gitosis script will pick up the name of the project and will add the path to the root directory which stores all gitosis-managed repository.

The same would apply for a gitolite setup, but with many more features ;)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250