Friday, September 12, 2008

Capistrano + Git: fatal: 'origin': unable to chdir or not a git archive

Getting that error?

Short answer: you fucked up, then Capistrano fucked up right behind you.

SSH into your deploy target, go into shared, and then frag the shared_cache directory.

Then, cap deploy:cold.

Why?

It normally happens when you try to set your repository as a local filesystem path. Capistrano populates shared_cache with an empty Git repo, and then tries to pull in your repository, which it can't reach... but it doesn't frag shared_cache, so the next time Capistrano looks, it's there, and goes, "Hey, we've already built the repository cache, let's just call git fetch and update it!"

Good luck.

1 comment:

l33z3r said...

thanks for this. really helped me dude