Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 932103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:36:36+00:00 2026-05-15T20:36:36+00:00

I am moving some svn repositories to Git. So, what I basically try to

  • 0

I am moving some svn repositories to Git. So, what I basically try to do is this:

  • Setup one server with bare Git repositories from which I will pull and push to
  • Setup a few backup servers for all of my repositories that are on the 1st server.

So, let’s say i have a directory on my server, like: $HOME/git/, which has bare repositories. Eg:

~/git/project1.git
~/git/project2.git
~/git/project3.git
...

My backup servers may be mirrors to this server, or keep the backed up data in archives or whatever. I suppose I can do something like:

git clone --bare ssh://gitserver/~user/git/projectX.git

Or maybe:

$ cd ~/git/project1.git
$ git bundle create ~/gitbackup/project1.bdl --all

and then copy all bundles from all projects to my backup servers.
However, having a lot of projects either strategy would be a tedious task, so in each case I would need to make some scripts to automate the task.

I wonder how are you guys doing this? Maybe there is some better way to do it than what I considered already. Any tip would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:36:37+00:00Added an answer on May 15, 2026 at 8:36 pm

    The general idea would be to:

    • create bare repo on your backup server
    • have hooks (probably a post-receive hook) on your main bare Git repository to automatically push whatever is received to the corresponding Git backup repo, either through git: protocol or ssh+git: protocol.

    There are other techniques back in 2008, based on gibak, but the idea remains the same.


    Example of a post-receive hook:

    • this one from Grant Limberg:
        #!/bin/sh
        #
        # A hook script that is called after a successful
        # commit is made.
        #
        # Place this file in .git/hooks and chmod +x
    
        BRANCH=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
        git push origin $BRANCH
    
    • that one (in ruby)
        #!/usr/bin/env ruby
        STDIN.read.split("\n").each do |line|
           oldrev, newrev, refname = line.split(' ')
    
           if refname.match(/^refs\/heads\/(.*)/)
             branch = $1
    
             `git push origin #{branch}`
           else
             puts "#{refname} was weird, not sure what to do."
           end
        end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.