Search code examples
gitolite

Create v3 gitolite repositories from existing v2 repos


I have got a gitolite v2 installed on my company's server, and now I have to administrate it. Since it's really chaotic there I decided to install a new one, now it's v3. I have around 8 repositories what I want to move to the new install.

I don't need the old .rc file or any configurations, just the (working!) $GIT_HOME/repositories/*.git

What I tried: (found it while searching for solution)
copied all $GIT_OLD_HOME/repositories/*.git to $GIT_HOME/repositories/*.git (except gitolite-admin.git and testing.git)

then I updated the gitolite-admin.git/conf/gitolite.conf (by cloning and pushing back changes) with this kind of entries:

repo myrepo1
RW+ = @all

Now if I want to clone anything other than gitolite-admin or testing, it sais:
FATAL: R any myrepo1 myusername DENIED by fallthru

Few things I've checked:
ls -l $GIT_HOME -> gitolite:gitolite it's ok I guess since gitolite is the user I want to use
I did the same for all entries in the repositories directory and the permissions are the same.

I was googling for a solution however I didn't find any that fits my case. If you can help me or suggest me anything, please don't hold back :)

If you need any more details to find out the answer just tell me.


Solution

  • Make sure you have migrated your .gitolite.rc file, as described in the g2->g3 migration page

    if you're migrating from g2, there are some settings that MUST be dealt with before running gitolite setup; please read the migration page and linked pages, and especially the one on "presetting the rc file"

    The rc file for g3 is quite different from that of g2.

    Or if you don't need the old one, as you mention, make sure the content of the default new one has appropriate values.

    Make sure your new ~git/.ssh/authorized_keys file does contain a line with myusername in it.


    The OP Attila Horvath confirms:

    Note: nothing in any of the gitolite install/setup/etc will ever touch the data in any repository except the gitolite-admin repo. The only thing it will normally touch in normal repos is the update hook."

    The last sentence just grabbed my attention, and it seems now that was the problem.
    I first installed gitolite then copied there the repos, so I had to run again gitolite setup -pk mykey.pub and now it seems working!