I have two issues. I have Ubuntu 10.10 and I have installed git server with gitolite tool. Everything worked quite good. The gl-setup command of gitolite created 2 repositories: gitolite-admin and testing.
1) QUESTION 1
My default gitolite admin user is called "git" and already created.
First, I had to clone the gitolite-admin repo, make some changes to let's say conf/gitolite.conf to add some new repo and a new user (I added the root user and I created and private/public key before and also added the public key to keydir folder), then I had to add/commit and push changes back.3
Info: I have my ~git/.ssh/authorized_keys file fine, starting with command= and having only one value - the public key of the git user I created first.
DIDN'T WORK:
git@vs1:~/$ git clone git@<<SERVER_IP>>:gitolite-admin.git
Initialized empty Git repository in /home/git/ga/gitolite-admin/.git/
git@<<SERVER_IP>>'s password:
fatal: 'gitolite-admin.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
WORKED:
touch ~/.ssh/config
with content:
host gitolite
user git
hostname <<SERVER_IP>>
identityfile ~/.ssh/git.pub
git@vs1:~/$ git clone gitolite:gitolite-admin
Initialized empty Git repository in /home/git/ga/gitolite-admin/.git/
Enter passphrase for key '/home/git/.ssh/git.pub':
Enter passphrase for key '/home/git/.ssh/git.pub':
Enter passphrase for key '/home/git/.ssh/git.pub':
git@89.35.160.243's password:
remote: Counting objects: 23, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 23 (delta 4), reused 0 (delta 0)
Receiving objects: 100% (23/23), done.
Resolving deltas: 100% (4/4), done.
Why I didn't work at all the first variant? All the tutorials say that it should work without any problems. I had to use the second variant with creating that host configuration in ~/.ssh/config file. This is a bit frustrating. The repo path is /home/git/repositories and the ssh is default port 22.
2) QUESTION 2
Using user root on the same server, I created an empty folder in let's say /var/www/example.com/www. I ran git init, then added a file (.gitignore), ran git add -A and git commit -m "...".
Then I created the remote path for origin:
git remote add origin git@<<SERVER_IP>>:myrepo.git
I ran git push origin master and this is what I got:
fatal: 'myrepo.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
I tried various things to change, like putting the whole path to the repository (even I didn't see that nowhere, so it isn't correct) and I got:
Counting objects: 3, done.
Writing objects: 100% (3/3), 243 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: ENV GL_RC not set
remote: BEGIN failed--compilation aborted at hooks/update line 20.
remote: error: hook declined to update refs/heads/master
To git@<<SERVER_IP>>:/home/git/repositories/myrepo.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'git@<<SERVER_IP>>:/home/git/repositories/myrepo.git'
What I doing wrong? This is getting frustrating since for such basic task I experience this unusual difficulties. I have great experience with SVN, these are the first plays with GIT.
Thank you in advance for your help!