Skip to main content

Clone, fetch, pull user's Github repositories

Project description

github-copier

A command line utility to clone all user repositories from Github or Bitbucket. If the repositories are already cloned, the utility receives the changes in all branches and tries to merge the changes in the current branch with the local repository.

How to install

  • $ cd ~
  • $ mkdir ghcopy
  • $ cd ghcopy
  • $ virtualenv --python=python3 .
  • $ source bin/activate
  • $ pip install git+git://github.com/oleglpts/github-copier.git (recommended) or
  • $ pip install ghcopy

You can not use a virtual environment if you do not need it. When installing without git (last line), you will have to clone the repository, create directory ~/.ghcopy and copy the configuration files and locales:

  • $ git clone https://github.com/oleglpts/github-copier.git
  • $ cd github-copier/ghcopy/data
  • $ mkdir ~/.ghcopy
  • $ cp config.json ~/.ghcopy
  • $ cp -r locale ~/.ghcopy
  • $ cd ../../..
  • $ rm -rf github-copier

See ~/.ghcopy/config.json:

{
    "environment": "",
    "user": "",
    "password": "",
    "token": "",
    "type": "github",
    or
    "type": "bitbucket",
    "locale_domain": "ghcopy",
    "language": "en",
    "locale_dir": "~/.ghcopy/locale",
    "log_file": "~/.ghcopy/ghcopy.log",
    "log_format": "%(levelname)-10s|%(asctime)s| %(name)s --- %(message)s (%(filename)s:%(lineno)d)"
}

You can change parameter values and specify a username and password or token if you do not want to specify them on the command line, but then the password and token will be stored in clear text. On July 1st, 2020, basic authentication using password to Github will no longer work, use a personal access token (PAT) with the appropriate scope to access repositories (parameter -t --token or token in config file). Visit https://github.com/settings/tokens for more information.

Command Line Tool

ghcopy [-h] [-c CONFIG] [-o OUTPUT] [-u USER] [-p PASSWORD] [-t token]
          [-l LOG_LEVEL]

optional arguments:
  -h, --help show this help message and exit
  -c CONFIG, --config CONFIG config file (default: ~/.ghcopy/config.json)
  -o OUTPUT, --output OUTPUT output directory (default: ~/RemoteCopies)
  -u USER, --user USER user name (default: parameter user from config file)
  -p PASSWORD, --password PASSWORD password (default: parameter password from config file)
  -t TOKEN, --token TOKEN personal access token (PAT) (default: parameter token from config file)
  -b HUB, --hub HUB repository type: github, bitbucket (default: parameter type from config file)
  -l LOG_LEVEL, --log_level LOG_LEVEL logging level: CRITICAL, ERROR, WARNING, INFO, DEBUG or NOTSET (default: INFO)

Requirements

  • GitPython>=3.0.8
  • PyGithub>=1.46
  • bitbucket-python>=0.2.2

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

ghcopy-0.0.3.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

ghcopy-0.0.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file ghcopy-0.0.3.tar.gz.

File metadata

  • Download URL: ghcopy-0.0.3.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

File hashes

Hashes for ghcopy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 2335f2cd0e1023270aae29f621fc4ef7c2d85e0fb00cd0bb68235f84818d39c8
MD5 c942a88ff4c70f19899e09df9ce4b5d1
BLAKE2b-256 0de9c1bc3654506929acfe99c50979af54bd45168c382cb796f77025a77f5c7b

See more details on using hashes here.

File details

Details for the file ghcopy-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ghcopy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7

File hashes

Hashes for ghcopy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cd8d05bc30f5baa3785559f8cfef6e1b0e1ca07ef45b350d5ebbcf67b300ac08
MD5 b90438575ea1620308beeea010890b94
BLAKE2b-256 6a10db42de297fb6f524b754f4b928cde96f3e72840473ef42cae6cbaf7a4d5a

See more details on using hashes here.

Supported by

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