All Projects → amitsaha → Gitbackup

amitsaha / Gitbackup

Licence: mit
Tool to backup your GitHub and GitLab repositories

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Gitbackup

mmd-gitlab-backuper
a package to backup from all projects that you have on gitlab
Stars: ✭ 27 (-71.28%)
Mutual labels:  gitlab, backup
Gitlabber
Gitlabber - clones or pulls entire groups tree from gitlab
Stars: ✭ 176 (+87.23%)
Mutual labels:  backup, gitlab
Scm Backup
Makes offline backups of your cloud hosted source code repositories
Stars: ✭ 38 (-59.57%)
Mutual labels:  backup, gitlab
Integram
Integrate Telegram into your workflow – Trello, Gitlab, Bitbucket and other bots
Stars: ✭ 1,365 (+1352.13%)
Mutual labels:  golang-application, gitlab
n3dr
Nexus3 Disaster Recovery (N3DR) is a tool that is capable of downloading all artifacts from a Nexus3 server and to migrate them to another Nexus3 server. Note that some repository formats are not supported at the moment.
Stars: ✭ 110 (+17.02%)
Mutual labels:  backup, golang-application
gitlab-mattermost-backup
A simple backup script for mattermost in gitlab omnibus package
Stars: ✭ 23 (-75.53%)
Mutual labels:  gitlab, backup
Glab
An open-source GitLab command line tool bringing GitLab's cool features to your command line
Stars: ✭ 1,126 (+1097.87%)
Mutual labels:  golang-application, gitlab
Agent
The best way to backup and restore your database
Stars: ✭ 80 (-14.89%)
Mutual labels:  backup
Docker Crashplan
CrashPlan docker container
Stars: ✭ 88 (-6.38%)
Mutual labels:  backup
Devops Kompose
[DEPRECATED] DevOps tools on Kubernetes with Helm charts
Stars: ✭ 78 (-17.02%)
Mutual labels:  gitlab
Bareos Webui
Bareos Web User Interface
Stars: ✭ 78 (-17.02%)
Mutual labels:  backup
Pgdump Aws Lambda
Lambda function for executing pg_dump and streaming the output to s3.
Stars: ✭ 80 (-14.89%)
Mutual labels:  backup
K3s Gitlab
k3s + Gitlab install notes
Stars: ✭ 89 (-5.32%)
Mutual labels:  gitlab
Gitlab Ci Dashboard
📊 Dashboard for monitoring GitLab CI builds and pipelines for TV
Stars: ✭ 79 (-15.96%)
Mutual labels:  gitlab
Content Lambda Boto3
Automating AWS with Lambda, Python, and Boto3
Stars: ✭ 91 (-3.19%)
Mutual labels:  backup
Minecraft Wrapper
A simple & intuitive Minecraft Server wrapper. Supports IRC, backups, a plugin system, and more.
Stars: ✭ 77 (-18.09%)
Mutual labels:  backup
Laravel Backup
A easy-to-use backup manager for Laravel
Stars: ✭ 93 (-1.06%)
Mutual labels:  backup
Xsrv
[mirror] Install and manage self-hosted services/applications, on your own server(s) - ansible collection and utilities
Stars: ✭ 89 (-5.32%)
Mutual labels:  backup
Ydcmd
Консольный клиент Linux/FreeBSD для работы с Яндекс.Диск (Yandex.Disk) посредством REST API
Stars: ✭ 87 (-7.45%)
Mutual labels:  backup
Gittar
🎸 Download and/or Extract git repositories (GitHub, GitLab, BitBucket). Cross-platform and Offline-first!
Stars: ✭ 87 (-7.45%)
Mutual labels:  gitlab

gitbackup - Backup your GitHub and GitLab repositories

Code Quality Go Report Card Linux/Mac OS X Build Status Windows Build status

gitbackup is a tool to backup your git repositories from GitHub (including GitHub enterprise) or GitLab (including custom GitLab installations).

gitbackup only creates a backup of the repository and does not currently support issues, pull requests or other data associated with a git repository. This may or may not be in the future scope of this tool.

If you are following along my Linux Journal article (published in 2017), please obtain the version of the source tagged with lj-0.1.

Installling gitbackup

Binary releases are available from the Releases page. Please download the binary corresponding to your OS and architecture and copy the binary somewhere in your $PATH. It is recommended to rename the binary to gitbackup or gitbackup.exe (on Windows).

Using gitbackup

gitbackup requires a GitHub API access token for backing up GitHub repositories and GitLab personal access token for GitLab. You can supply the token to gitbackup using GITHUB_TOKEN and GITLAB_TOKEN environment variables respectively.

OAuth Scopes required

GitHub

  • repo: Reading repositories, including private repositories
  • user - read:user: Reading the authenticated user details. This is only needed for retrieving your username when cloning via HTTPS and retrieving private repositories.

GitLab

  • api: Grants complete read/write access to the API, including all groups and projects. For some reason, read_user and read_repository is not sufficient.

Security and credentials

When you provide the tokens via environment variables, they remain accessible in your shell history and via the processes' environment for the lifetime of the process. By default, SSH authentication is used to clone your repositories. If use-https-clone is specified, private repositories are cloned via https basic auth and the token provided will be stored in the repositories' .git/config.

Examples

Typing -help will display the command line options that gitbackup recognizes:

$ gitbackup -help
Usage of ./bin/gitbackup:
  -backupdir string
        Backup directory
  -githost.url string
        DNS of the custom Git host
  -github.repoType string
        Repo types to backup (all, owner, member) (default "all")
  -gitlab.projectMembershipType string
        Project type to clone (all, owner, member) (default "all")
  -gitlab.projectVisibility string
        Visibility level of Projects to clone (internal, public, private) (default "internal")
  -ignore-private
    	Ignore private repositories/projects
  -service string
    	Git Hosted Service Name (github/gitlab)
  -use-https-clone
    	Use HTTPS for cloning instead of SSH

Backing up your GitHub repositories

To backup all your GitHub repositories to the default backup directory ($HOME/.gitbackup/):

$ GITHUB_TOKEN=secret$token gitbackup -service github

To backup only the GitHub repositories which you are the "owner" of:

$ GITHUB_TOKEN=secret$token gitbackup -service github -github.repoType owner

To backup only the GitHub repositories which you are the "member" of:

$ GITHUB_TOKEN=secret$token gitbackup -service github -github.repoType member

Backing up your GitLab repositories

To backup all projects you either own or are a member of which have their visibility set to "internal" on https://gitlab.com to the default backup directory ($HOME/.gitbackup/):

$ GITLAB_TOKEN=secret$token gitbackup -service gitlab

To backup only the GitLab projects (either you are an owner or member of) which are "public"

$ GITLAB_TOKEN=secret$token gitbackup -service gitlab -gitlab.projectVisibility public

To backup only the private repositories (either you are an owner or member of):

$ GITLAB_TOKEN=secret$token gitbackup -service gitlab -gitlab.projectVisibility private

To backup public repositories which you are an owner of:

$ GITLAB_TOKEN=secret$token gitbackup \
    -service gitlab \
    -gitlab.projectVisibility public \
    -gitlab.projectMembershipType owner

To backup public repositories which you are an member of:

$ GITLAB_TOKEN=secret$token gitbackup \
    -service gitlab \
    -gitlab.projectVisibility public \
    -gitlab.projectMembershipType member

GitHub Enterprise or custom GitLab installation

To specify a custom GitHub enterprise or GitLab location, specify the service as well as the the githost.url flag, like so

$ GITLAB_TOKEN=secret$token gitbackup -service gitlab -githost.url https://git.yourhost.com

Specifying a backup location

To specify a custom backup directory, we can use the backupdir flag:

$ GITHUB_TOKEN=secret$token gitbackup -service github -backupdir /data/

This will create a github.com directory in /data and backup all your repositories there instead. Similarly, it will create a gitlab.com directory, if you are backing up repositories from gitlab. If you have specified a Git Host URL, it will create a directory structure data/host-url/.

Building

If you have Golang 1.12.x+ installed, you can clone the repository and:

$ go build

The built binary will be gitbackup.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].