---
title: "Synchronizing SVN With an HTTPS URL"
description: "Creating a read-only mirror of a repository from a HTTPS which is in sync helps to maintain an local repo which is in sync."
url: "https://h3manth.com/scribe/synchronizing-svn-https-url/"
canonical_url: "https://h3manth.com/scribe/synchronizing-svn-https-url/"
markdown_url: "https://h3manth.com/scribe/blog/synchronizing-svn-https-url.md"
publishDate: "2010-01-05T00:00:00.000Z"
author: "Hemanth HM"
category: "web"
tags: ["git"]
word_count: 208
reading_time_minutes: 2
x_markdown_tokens: 457
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Synchronizing SVN With an HTTPS URL

> Creating a read-only mirror of a repository from a HTTPS which is in sync helps to maintain an local repo which is in sync.

Creating a read-only mirror of a repository from a HTTPS which is in sync helps to maintain an local repo which is in sync with the global and is much faster and reliable for a group working locally. Achieving this is pretty simple,**svnsync - Subversion repository synchronization tool** which makes the job easier.

The idea is pretty simple, the steps followed are : _1.Setting up a mirror repository. 2.Initialize (init) the sync. 3.Synchronizing the data. 4.Making a sync job._

**Setting up a mirror repository:** ``

## Create a mirror repository

$ svnadmin create ~/test-mirror

## add a commit hook

$ cat <<'EOF' > ~/test-mirror/hooks/pre-revprop-change

## !/bin/sh

USER="$3" if [ "$USER" = "user-name" ]; then exit 0; fi echo "Permission denied" exit 1 EOF

## user-name is the desired user name

## Set permissions

$ chmod +x ~/test-mirror/hooks/pre-revprop-change 

**Initialize (init) the sync:** ` $ svnsync init --username $USER file://$HOME/test-mirror `

**Synchronizing the data:** ` svnsync --non-interactive sync file://$HOME/test-mirror `

**Making a sync job:**

## Cron

`0 2 * * * * svnsync --non-interactive sync file://$HOME/test-mirror`

## immediate synchronization whenever a commit is made

Add the below lines to master-repo/hooks/post-commit

`svnsync --non-interactive sync mirror-url &`

## for log messages, append the following to master-repo/hooks/post-revprop-change

`svnsync --non-interactive copy-revprops mirror-url ${REV} &`
