Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daido1976/gh-default-branch
GitHub CLI extension to show & rename the default branch.
https://github.com/daido1976/gh-default-branch
gh-extension
Last synced: 3 months ago
JSON representation
GitHub CLI extension to show & rename the default branch.
- Host: GitHub
- URL: https://github.com/daido1976/gh-default-branch
- Owner: daido1976
- Created: 2021-10-16T06:30:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-28T12:23:23.000Z (almost 2 years ago)
- Last Synced: 2023-03-02T00:16:27.617Z (over 1 year ago)
- Topics: gh-extension
- Language: Rust
- Homepage:
- Size: 30.3 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gh-default-branch
GitHub CLI extension to show & rename the default branch.
`rename` subcommand was inspired by [this gist](https://gist.github.com/mislav/5ac69530acbe1b4ca909e272caabfdba).
### ⚠️ Caution
The `rename` subcommand is missing some features.
If you want any of the following missing features, try to change the default branch name from the GUI.
See. https://github.com/github/renaming#renaming-existing-branches
> - [x] Re-target any open pull requests
> - [ ] Update any draft releases based on the branch
> - [ ] Move any branch protection rules that explicitly reference the old name
> - [ ] Update the branch used to build GitHub Pages, if applicable
> - [ ] Show a notice to repository contributors, maintainers, and admins on the repository homepage with instructions to update local copies of the repository
> - [ ] Show a notice to contributors who git push to the old branch
> - [ ] Redirect web requests for the old branch name to the new branch name
> - [ ] Return a "Moved Permanently" response in API requests for the old branch nameAlso see. https://github.com/cli/cli/issues/1215
## Installation
```
$ gh extension install daido1976/gh-default-branch
```## Usage
```sh
# Show the default branch
$ gh default-branch show# Show just the name of the default branch (e.g. main)
$ gh default-branch show -n # or --name-only# Rename the default branch
$ gh default-branch rename
```## Development
### Debug
Debug with [gh-default-branch](https://github.com/daido1976/gh-default-branch/blob/main/gh-default-branch) script.
```sh
$ gh extension install .
$ gh default-branch
```### Release
This extension is released as a [precompiled extension](https://docs.github.com/en/github-cli/github-cli/creating-github-cli-extensions#creating-a-precompiled-extension-manually).
```sh
$ git tag
$ git push --tag
```