Skip to main content

Fork a GitHub repo, clone that repo to a local directory, add the upstream remote, create an optional feature branch and checkout that branch

Usage

usage: fork-github-repo [-h] [--config CONFIG] url [branch]

Fork a GitHub repo, clone that repo to a local directory, add the upstream
remote, create an optional feature branch and checkout that branch

positional arguments:
  url              GitHub URL of the upstream repo to fork
  branch           Name of the feature branch to create

optional arguments:
  -h, --help       show this help message and exit
  --config CONFIG  Filename of the yaml config file (default :
                   ~/.github/fork_github_repo.yaml)

Config

The config file with a default location of ~/.github/fork_github_repo.yaml contains the following settings.

  • github_token : The GitHub personal access token with the public_repo scope allowed

  • repo_dir : The directory path to the directory containing all your cloned repos. If this isn’t defined, /tmp is used.

Examples

Fork Spoon-Knife

$ fork-github-repo https://github.com/octocat/Spoon-Knife.git
Forked https://github.com/octocat/Spoon-Knife.git to https://github.com/gene1wood/Spoon-Knife.git
Cloned https://github.com/gene1wood/Spoon-Knife.git to /home/gene/code/github.com/gene1wood/Spoon-Knife
Remote "upstream" created for https://github.com/octocat/Spoon-Knife.git
Remote "upstream" fetched

Fork Spoon-Knife and create a feature branch called ‘my-feature’

$ fork-github-repo https://github.com/octocat/Spoon-Knife.git my-feature
Forked https://github.com/octocat/Spoon-Knife.git to https://github.com/gene1wood/Spoon-Knife.git
Cloned https://github.com/gene1wood/Spoon-Knife.git to /home/gene/code/github.com/gene1wood/Spoon-Knife
Remote "upstream" created for https://github.com/octocat/Spoon-Knife.git
Remote "upstream" fetched
Branch "my-feature" created and checked out

Download files

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

Source Distribution

fork-github-repo-1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

fork_github_repo-1.0-py2-none-any.whl (5.8 kB view details)

Uploaded Python 2

File details

Details for the file fork-github-repo-1.0.tar.gz.

File metadata

File hashes

Hashes for fork-github-repo-1.0.tar.gz
Algorithm Hash digest
SHA256 aaeb4250fdb01fa1149ec511eb4bf7586055ec779682247b89599ae3a0e59112
MD5 38b8910eda274e3d419825885dc8b90e
BLAKE2b-256 ab0527cbd491024ce141d1b8da69ad6b25c27ddf6ef050f394f5349b371bfd4f

See more details on using hashes here.

File details

Details for the file fork_github_repo-1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for fork_github_repo-1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 56d6e49f4f49567f88f51428eddcfbec20f1cab5a10d1291e950d973f73a381a
MD5 07cf6f512e752033af725bd0d1e6d37b
BLAKE2b-256 d8019cafa17de92234ac5ac8658f6567996dd61f68d95a124419ee40495f130d

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

This release

1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page