Skip to main content

Backup and archive Git Repos and Gists from GitHub

Project description

githubtakeout

Backup and archive Git Repos and Gists from GitHub



About:

githubtakeout is a data export tool for backing up and archiving Git repositories hosted on GitHub. It clones a user's repos and creates an archive of each.

It supports public/private repos and public/secret gists. By default, it doesn't save commit history or branches (.git directory), or Gist repositories (both can be enabled with command line options).

When you run the program, archives of your repos will be saved in a directory named backups inside your current working directory, unless a different location is specified using the --dir option.

Archives are saved in compressed zip format (.zip) by default. You can also save as tarballs (.tar.gz) using the --format=tar option, or skip archiving using the --format=none option.

Requirements:

  • Python 3.12+
  • Git 1.7+

Installation:

Install from PyPI:

pip install githubtakeout

Authentication:

By default, githubtakeout will only retrieve an account's public repos. To access private repos and secret gists, you need to authenticate.

First, you must create a personal access token on Github (either a fine-grained or classic personal access token). Once you have a token, you can set the GITHUB_TOKEN environment variable:

$ export GITHUB_TOKEN=<access token>

If you prefer to be prompted for your token each time you run the program, use the --token argument.

CLI Options:

usage: githubtakeout [-h] [--dir DIR] [--format {tar,zip,none}] [--gists] [--history] [--list] [--token] username

positional arguments:
  username                 github username

options:
  -h, --help               show this help message and exit
  --dir DIR                output directory (default: .)
  --format {tar,zip,none}  archive format (default: zip)
  --gists                  include gists
  --history                include commit history and branches (.git directory)
  --list                   list repos only
  --token                  prompt for auth token

Usage Examples:

Install from PyPI with pipx, Run:

pipx install githubtakeout
githubtakeout <github username>

Clone Repo, Create/Activate Virtual Environment, Install from Source, Run:

git clone git@github.com:cgoldberg/githubtakeout.git
cd ./githubtakeout
python3 -m venv venv
source venv/bin/activate
pip install .
githubtakeout <github username>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

githubtakeout-0.1.12.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

githubtakeout-0.1.12-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file githubtakeout-0.1.12.tar.gz.

File metadata

  • Download URL: githubtakeout-0.1.12.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for githubtakeout-0.1.12.tar.gz
Algorithm Hash digest
SHA256 92099fe6751890d83797c26b7098c98a9753496f5ed192cf1d4562dfe4c83668
MD5 e15dbd91f2ecfb713f46477da4786c41
BLAKE2b-256 cd6df7ea7e2676efceae8c953306544745b0f884849141c8a82c189e988b8ca0

See more details on using hashes here.

File details

Details for the file githubtakeout-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: githubtakeout-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for githubtakeout-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 dab81529eb89a0a2089435186b7ed726de2ab8f87494ccc4195df20f92cf5449
MD5 ed317a50be5e3a515046cafe1ad5e3c0
BLAKE2b-256 b9f2bc9cb230dbd42ec5d3aff06ec287caf32ecc25c48fb7804b89fd58ce338a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page