Commit e8bd94fa authored by Francisco Juan's avatar Francisco Juan

Backup git repositories with --bare option and fetching all branches on syncing

Update git command for initialization of repositories with the --bare option
Change syncing git repositories command from 'git clone' to 'git fetch'
parent c8009ede
......@@ -193,13 +193,13 @@ end
def init_git_repository(repository)
title "Initializing git repository #{repository}", 2
path = File.join(LOCAL_GIT_PATH)
shell "cd #{path} && git clone #{repository}"
shell "cd #{path} && git clone --bare #{repository}"
def sync_git_repository(repository)
title "Syncing repository #{repository}", 2
path = File.join(LOCAL_GIT_PATH, repository)
shell "cd #{path} && git pull"
shell "cd #{path} && git fetch origin"
def rdiff_get(source, destination)
......@@ -240,7 +240,7 @@ namespace :backup do
file =, "r")
while (repository = file.gets)
repository_folder = repository.split('/').last.gsub('.git','')
repository_folder = repository.split('/').last
init_git_repository(repository) unless git_exists?(repository_folder)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment