Search code examples
linuxgitubuntusshgitolite

Failed to clone gitolite repo and lead to fatal error


I am trying to clone the gitolite-admin.git repo from my own server after "successfully" installing gitolite (multiple ways: apt-package, github source), but it always gives the same error.

$ git clone git@******:gitolite-admin
Cloning into 'gitolite-admin'...
git@******'s password:
fatal: 'gitolite-admin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

My setup

  • on git user
  • Ubuntu 20.04

I tried

  • gitolite3 apt-package
  • gitolite github version
  • editing ~/.ssh/conf (from a previous stack overflow solution 8 years ago)
  • access from same machine, but different user
  • access from my main pc (different network)

I read/watched

  • YouTube installations (from 2013)
  • solutions from multiple different websites
  • applying ssh sections from gitolite
  • ...and nearly the whole docs from gitolite

What I discovered/think

  • keydir for example doesnt even exist in my installation
  • changing ~/.ssh/config didnt do anything
  • most of previous solutions are simply outdated

I started working with gitolite only since today but already feel quite exhausted I am open for any solution offered, please help me if you can :)


Solution

  • Check first your ~git/.ssh/authorized_keys on the Gitolite server: if you want to clone a gitolite-managed repository (including the main gitolite-admin one), your public key should be:

    Otherwise, assuming your public key is registered (not for gitolite, just for regular interactive SSH session), then your clone would be:

    git clone git@******:/full/path/to/gitolite-admin
    

    The OP justsomexanda adds in the comments:

    I relinked my pub- and priv-keys.
    After rechecking them I could clone "testing" but not "gitolite-admin" so I looked closer and saw that in repositories/gitolite-admins/gl-conf there was the name of my key (which I called 'myKey') but it was not the same identities which I logged in (named 'alex').
    I changed the name in the conf and it worked.

    So in summary: just check you name the keys right and you are using the correct identity.