Skip to content

Installation

Akash Rajpurohit edited this page Aug 24, 2024 · 8 revisions

Download Pre-built Binaries

The simplest way is to install the pre-built binaries which are available for various platforms. You can download the latest release from the Releases page.

Using go get

Prerequisites

  • Go (version 1.22 or later)
  • Git
go get github.com/AkashRajpurohit/git-sync

Build from source

git clone https://github.com/AkashRajpurohit/git-sync.git
cd git-sync
go install
go build

With Docker

The docker images are available on GitHub package registry and can be found here: https://github.com/AkashRajpurohit/git-sync/pkgs/container/git-sync

For finding the PGID and PUID values, you can use these commands:

PGID: $(id -g)

PUID: $(id -u)

For default user, it should normally be 1000 for both user id and group id.

docker run \
  --name=git-sync \
  -e PUID=1000 \
  -e PGID=1000 \
  -v ~/.config/git-sync/config.yaml:/git-sync/config.yaml \
  -v ~/git-backups:/backups \
  ghcr.io/akashrajpurohit/git-sync:latest

Or you can use the docker-compose.yml file to run the container.

services:
  git-sync:
    image: ghcr.io/akashrajpurohit/git-sync:latest
    volumes:
      - ~/.config/git-sync/config.yaml:/git-sync/config.yaml
      - ~/git-backups:/backups
    environment:
      - PUID=1000
      - PGID=1000
    restart: unless-stopped
docker-compose up -d

NOTE: If you are using docker, then it is best to use the inbuilt cron functionality and keep the service running in background and syncing up your repositories periodically.

Clone this wiki locally