There's no reason you need to copy the .git directory. Just set
:copy_exclude to %w(.git) and it should ignore that directory.

As for why it's implemented the way it is: it's for compatibility with
other SCM's. Git is not the only SCM capistrano supports, so the
built-in deployment strategies have to support the "lowest common
denominator". By all means, though, implement your idea and release it
as a git-specific deployment strategy. If it's useful to you, I'm sure
it'd be useful to others.

- Jamis

On Thu, Mar 19, 2009 at 5:14 PM, bkw <[email protected]> wrote:
>
> Hi *,
>
> being a new capistrano (and ruby-) user I wonder whether the use of
> git with :remote_cache could not be made more effecient. Right now, we
> copy the whole checkout including the .git directory for every
> release.
> IMHO the following would be much faster and more space efficient:
>
> # first checkout of the repo cache as a bare. (only done once):
> git clone --mirror #{repository} #{repository_cache}
>
> # update the repo cache before each checkout:
> git --git-dir=#{repository_cache} fetch #{repository}
>
> # checkout a release from the repo cache:
> mkdir #{release_path} && \
>  cd #{release_path} && \
>  git --git-dir=#{repository_cache} --work-dir=. reset --hard #
> {branch}
>
>
> This way we would keep a bare repository without any checked out files
> current in the repository cache, and produce a quick and slim checkout
> for the release without duplicating the whole .git directory
> everytime.
> This would save both deployment time and storage space, in my case
> quite significantly.
>
> Did I overlook a compelling reason not to go this route? I'm about to
> dig into cap's internals to try to implement this (as a plugin
> maybe?), but before I waste my time on something stupid, I'd rather
> ask for advice here.
>
> Any thoughts?
>  bkw
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to