1

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.

Attila Horvath
  • 344
  • 5
  • 15

2 Answers2

1

I had the same problem and upgrading did not work as it should so I used the following strategy - the bold text represents where was the step executed:

1- New: Install Gitolite (https://github.com/sitaramc/gitolite).

2- Workstation: In a new empty directory clone the gitolite-admin of the old version and rename it to gitolite-admin-old. Remove access to all users in gitolite-admin-old/conf/gitolite.conf except yourself - To disable anyone to do any change while you are migrating the repositories.

3- Workstation: Clone all repositories from the old Gitolite. git clone git@oldserver.com:repo.

4- Old: We already got what we want from the old repository. Disable old gitolite for good by adding exit 0 at the top of .gitolite.rc file.

5- Workstation: Clone gitolite-admin from the new server git clone git@newserver.com:gitolite-admin gitolite-admin-new

6- Workstation: Copy keys from the gitolite-admin-old/keydir to the gitolite-admin-new/keydir, add the repositories you want to transfer in the new gitolite-admin-new/conf/gitolite.conf with the user priviledges. add, commit and push.

7- Workstation: Push each required repository to the new server

git push --all git@newserver.com:repo
git push --tags git@newserver.com:repo
or
git push --mirror git@newserver.com:repo

8- Workstations: Change DNS or remote URL from each working repo.

Hope this helps

wael34218
  • 4,860
  • 8
  • 44
  • 62
0

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!

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Related questions: http://stackoverflow.com/questions/10499002/please-help-me-understand-gitolite-users, http://stackoverflow.com/q/12617672/6309, http://stackoverflow.com/q/10843781/6309 – VonC Mar 20 '13 at 13:14
  • Thank you for your reply VonC! I have an appropriate entry in my `~git/.ssh/authorized_keys` like: `# gitolite start command=... mypubkey # gitolite end` – Attila Horvath Mar 20 '13 at 13:20
  • Also I've checked the official migration page before, but I think I did everything well, since I don't need previous configurations or the .rc file. – Attila Horvath Mar 20 '13 at 13:27
  • @AttilaHorvath does your entry contains 'myusername'? as in `command="/home/git/bin/gitolite-shell myusername",no-port-forwarding,...` g3 should use `gitolite-shell`. – VonC Mar 20 '13 at 13:33
  • Yes, it does, but there is a little difference. Here is mine: `command="$GIT_HOME/src/gitolite-shell myusername",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty` I have a bin directory in $GIT_HOME, but it contains only gitolite. – Attila Horvath Mar 20 '13 at 13:36
  • How dumb I am! "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! Thank you @VonC for your help! – Attila Horvath Mar 20 '13 at 13:57
  • @AttilaHorvath great! I have included your conclusion in the answer for more visibility. – VonC Mar 20 '13 at 16:23