Gitosis and Capistrano: unable to chdir or not a git archive

Capistrano, Git, Ruby on Rails No Comments »

If you get this error:

unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly

after running

cap deploy:cold

you might have to add the public key of the deploy user you set up with

set :user, “deploy”

in your capistrano deploy.rb file, to the /home/git/.ssh/authorized_keys on the REMOTE server.

Of course gitosis has a special process managing the keys and users from the LOCAL machine in the ~/gitosis/gitosis-admin directory, so you have copy the public key you generated for the deploy user on your REMOTE server via

ssh-keygen -t rsa

to your LOCAL machine (via scp or cut and paste into a new deploy.pub file from the ssh shell for example) and then proceed as outlined here (under “Adding Users”):

cd ~/gitosis/gitosis-admin
cp ~/deploy.pub keydir/
git add keydir/deploy.rb

Add the user credentials to the gitosis.conf file:

[group myrailsteam]
writable = myrailsapp
members = deploy

Finally run

git commit -a -m “Granted deploy user access rights to myrailsapp”
git push
 

Now the cap deploy:cold should work (with one fewer errors that is ).
 

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in