I have two questions. I have Ubuntu 10.10 and I installed a git server with a guitar tool. Everything worked well. The glit setup team of githolite created 2 repositories: gitolite-admin and testing.
1) QUESTION 1
My admin user, gitolite, is by default called "git" and has already been created.
Firstly, I had to clone the gitolite-admin repo, make some changes to say conf / gitolite.conf, to add a new repo and a new user (I added the root user and I created as well as the private / public key before and also added public key in the keydir folder), then I had to add / commit and push the changes back.
Info: I have a ~ git / file. ssh / authorized_keys starting with command = and having only one value is the public key of the git user that I created first.
DOES NOT 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>> password: fatal: 'gitolite-admin.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly
HAVE 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 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 didnβt I work in the first version at all? All textbooks say that it should work without problems. I had to use the second option with creating this host configuration in the ~ / .ssh / config file. This is a little disappointing. The repo path is / home / git / repositories, and ssh is the default port 22.
2) QUESTION 2
Using the root of the user on the same server, I created an empty folder, let it say /var/www/example.com/www. I ran git init, then added the file (.gitignore), ran git add -A and git commit -m "...".
Then I created a remote path for the source:
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 different things to change, for example, put it all the way to the repository (even I did not see it anywhere, so this is wrong), 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 am I doing wrong? This is frustrating, because for such a basic task I experience such unusual difficulties. I have a lot of experience with SVN, these are the first games with GIT.
Thank you in advance for your help!