Created
February 7, 2013 20:26
-
-
Save wpeterson/4733888 to your computer and use it in GitHub Desktop.
Useful capistrano tasks for git cache_copy maintenance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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