I am new to gitolite. I am trying to do a very simple test with gitolite. I have setup my repository called "test_repo". Please note that I have not modified anything else otherthan what I have stated below. I can see this repo in gitweb. This is the repo configuration
repo test_repo
RW+ = @all
Now I want to clone this repo. I have ldap access to server. By my understanding of @all, it should allow me to do this.
when I issue
git clone git@myserver:repositories/test_repo.git
#I know this is wrong. But I just wanted to test as the above did not work
or
git clone git@myserver:test_repo.git
its asking for password. I have followed this guide http://sharadchhetri.com/2013/05/31/how-to-create-own-git-server-with-gitolite-and-gitweb-in-ubuntu/, which does not set a password for git user
When I issue
git clone myname@myserver:test_repo.git
I am getting the following error
fatal: 'test_repo.git' 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.
I also tired to clone the default repo "test_repo.git". But I am getting the same error.
I also tired this
git clone myname@myserver:/home/git/repositories/testing.git
then cloning is working. But when I do git push -u origin master
some modified files I am getting
error: insufficient permission for adding an object to repository database ./objects
fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
! [remote rejected] master -> master (n/a (unpacker error))
Note: I have not added any user in conf file
Any help is appreciated.
just try
ssh git@hostname-or-ip
This should not ask password; it can ask passphrase. This will also emit list of repositories you have access to.
BTW - username@localhost in git clone command is grossly wrong
What should work is:
You shouldn't specify the 'repositories' folder (gitolite knows where the repo is supposed to be)
That supposes that
ssh -Tvvv git@myserver
works (ie do not ask password).Make that ssh work first, and then try again the
git clone
.As I say in the comment, LDAP and ssh are both authentication mechanism, so you can use one or the other, not both:
If the ssh works, but the clone doesn't work, then you need to have a look in the gitolite logs at
~git/.gitolite/logs
That means the issue is on the ssh level, not calling properly gitolite: that is in
~git/.ssh/authorized_keys
, and happens if you add an ssh key manually directly in it, instead of adding through thekeys
folder of thegitolite-admin
repo and pushing back that repo to the gitolite server (which triggers the update of said~git/.ssh/authorized_keys file
).