git-sync

Created: 2012-03-21 10:28
Updated: 2013-10-12 02:39
License: agpl-3.0

README.mkd

Git-sync 1.8 README

INTRODUCTION

This is set of scripts to synchronize git repositories for several servers

HOW IT WORKS

This scripts perform next steps:

  • Clone the original remote repository of specified projects to local direcotory.

  • Add custom remote repositories for each project.

  • Update the local repositories master branch.

  • Push the local repositories master branch to custom remote repositories.

INSTALL

This application can work without installation. But you can build deb package with it:

$ make deb

Also you can install git-sync to your system from sources:

$ make install

CONFIGURE

Specify next data to configure your repositories synchronization:

  • Set project names to synchronize in conf/projects.conf file.

  • Set connection strings (hostnames with username and path) for git servers in conf/servers.conf file.

  • Set the original git primary server connection string (PRIMARY_ORIGIN_REPO) in conf/git-sync.conf file.

  • Set the original git secondary server connection string (SECONDARY_ORIGIN_REPO) in conf/git-sync.conf file. It will be used if target project is unavailable from primary repo.

  • Set local directory for temporary files (PROJECTS_DIR) in conf/git-sync.conf file.

  • Set path of ssh keys files (SSH_KEY_PATH) in conf/git-sync.conf file.

  • Set ssh keys file names in conf/keys.conf file.

USAGE

Type this command to perform all synchronization operations:

$ git-sync.sh -ils

This is command to "fast" synchronization without initialization local repos:

$ git-sync.sh -ls

git-sync.sh is a main interface script for several service ones. These service scripts perform work of each synchronization operation:

git-init.sh - performs cloning of origin remote repos to local directory

git-pull.sh - performs fetch and pull from origin remote repo

git-push.sh - performs push master branch to all custom remote repos

You can use these manually. Just specify for each script argument with projects directory path. For example:

$ git-init.sh /srv/sync

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more