A Python script for bulk renaming the default branch of your GitHub repositories using the API
Project description
The default git/GitHub branch name is oppressive terminology (more info). It is easy to change the branch name for a single repository or for new repositories. This script makes it easy to rename your default branch on GitHub repositories in bulk.
Usage
To install, run
python -m pip install rename-github-default-branch
Then, create a GitHub.com personal access token with the repo
permission scope and set the environment variable:
export RENAME_GITHUB_TOKEN=YOUR_PERSONAL_ACCESS_TOKEN
Then to rename the default branch to main
for a specific repository (you must have write access):
rename-github-default-branch -r dfm/rename-github-default-branch -t main
Or for all the repos that you own (excluding forks):
rename-github-default-branch -t main
You can also provide regular expressions to match against the repository name. For example:
rename-github-default-branch -t main -p dfm/* -p exoplanet-dev/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rename_github_default_branch-0.0.1.tar.gz
.
File metadata
- Download URL: rename_github_default_branch-0.0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3768a78431b7e1ccc41985e544ce37ac953f67cb40bdc9405c5fe72286194b83 |
|
MD5 | 71571065191291a20f4020504a2b1e09 |
|
BLAKE2b-256 | 040d53d3ac34c842615d58d378970af5f5d865bd6a4608129100fd7f60bf3698 |
File details
Details for the file rename_github_default_branch-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: rename_github_default_branch-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e550f4241bf2623b90261440bd203684687e1d465c3c154114b6daabf96a4d35 |
|
MD5 | 382e93c76162c51bdaeaae8d150a17fb |
|
BLAKE2b-256 | 85105b0c23de7bc3e47f0f34a7bda4fe83e13b21d1e4ed8b329e8ce276ac94d8 |