Skip to content

Instantly share code, notes, and snippets.

@wpeterson
Created February 7, 2013 20:26
Show Gist options
  • Save wpeterson/4733888 to your computer and use it in GitHub Desktop.
Save wpeterson/4733888 to your computer and use it in GitHub Desktop.
Useful capistrano tasks for git cache_copy maintenance
namespace :git do
desc "Prune remote git cached copy (fixes errors with deleted branches)"
task :prune do
repository_cache = File.join(shared_path, 'cached-copy')
logger.info "Pruning origin in remote cached-copy..."
run "cd #{repository_cache}; git remote prune origin"
end
desc "Clear Capistrano Git cached-copy"
task :clear_cache do
repository_cache = File.join(shared_path, 'cached-copy')
logger.info "Clearing Git Cache: #{repository_cache}"
run "rm -rf #{repository_cache}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment