Giter Club home page Giter Club logo

git-backup's Introduction

git-backup

A cli to pull all your git repositories for backup purposes. It is completely stand-alone. You don't even need to install git.

Download

The latest version can be downloaded from the releases page.

Configuration File

Example yaml Configuration:

# The github section contains backup jobs for
# GitHub and GitHub Enterprise
github:
    # (optional) The job name. This is used to
    # create a subfolder in the backup folder. 
    # (default: GitHub)
  - job_name: github.com
    # (required) The GitHub personal access
    # token. Create one with the scopes:
    # "read:org, repo"
    # https://github.com/settings/tokens/new?scopes=repo,read:org
    access_token: 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
    # (optional) Back up repos you own.
    # (default: true)
    owned: true
    # (optional) Back up repos you starred.
    # (default: true)
    starred: true
    # (optional) Back up repos on which you 
    # are a collaborator. (default: true)
    collaborator: true
    # (optional) Back up repos owned by 
    # organisations of which you are a member.
    # (default: true)
    org_member: true
    # (optional) Set this url to connect to
    # your self-hosted github install.
    # (default: https://api.github.com)
    url: https://github.mydomain.com
    # (optional) Exclude this list of repos
    excluded:
      - my-namespace/excluded-repository-name
# The gitlab section contains backup jobs for
# GitLab.com and GitLab on premise
gitlab:
  # (optional) The job name. This is used to
  # create a subfolder in the backup folder. 
  # (default: GitLab)
  - job_name: gitlab.com
    # (required) The GitLab access token.
    # Create one with the scopes: "api"
    # https://gitlab.com/-/profile/personal_access_tokens?scopes=api&name=git-backup
    access_token: glpat-6t78yuihy789uy8t768
    # (optional) Back up repos you own.
    # (default: true)
    owned: true
    # (optional) Back up repos you starred.
    # (default: true)
    starred: true
    # (optional) Back up repos owned by 
    # teams of which you are a member.
    # (default: true)
    member: true
    # (optional) Set this url to connect to
    # your self-hosted gitlab install.
    # (default: https://gitlab.com/)
    url: https://gitlab.mydomain.com
    # (optional) Exclude this list of repos
    excluded:
      - my-namespace/excluded-repository-name

Usage: CLI

Usage: git-backup

Options:
  -backup.path string
        The target path to the backup folder. (default "backup")
  -config.file string
        The path to your config file. (default "git-backup.yml")
  -backup.fail-at-end
      Fail at the end of backing up repositories, rather than right away.
  -backup.bare-clone
      Make bare clones without checking out the main branch.
  -version
      Show the version number and exit.

Usage: Docker

First, create your git-backup.yml file at /path/to/your/backups.

Then update your backups using the mounted volume.

docker run -v /path/to/backups:/backups ghcr.io/chappio/git-backup:1

Parameters

You can specify several parameters when starting this container.

Parameter Description
-v /path/to/backups:/backups Mount the folder where you want to store your backups and read you configuration file.
-e TZ=Europe/Amsterdam Set the timezone used for logging.
-e PUID=0 Set the user id of the unix user who will own the backup files in /backup.
-e PGID=0 Set the group id of the unix user's group who will own the backup files.

git-backup's People

Contributors

chappio avatar schoentoon avatar lucascorpion avatar kleinmann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.