@@ -19,7 +19,9 @@ npm install -g github-default-branch
19
19
20
20
## Authentication
21
21
22
- [ Create a personal access token] ( https://github.com/settings/tokens/new ) with the ` repo ` scope. This is the value for ` <token> ` in the examples
22
+ [ Create a personal access token] ( https://github.com/settings/tokens/new ) with the ` repo ` scope. This is the value for ` <token> ` in the examples.
23
+
24
+ > If you don't want your token to be stored in your shell history, you can set ` GITHUB_TOKEN ` in the environment and that will be read instead
23
25
24
26
## Usage
25
27
@@ -29,6 +31,12 @@ github-default-branch --pat <token> --repo user/repo
29
31
30
32
# Rename dev to develop
31
33
github-default-branch --pat <token> --repo user/repo --old dev --new develop
34
+
35
+ # Rename all repos owned by an org
36
+ github-default-branch --pat <token> --org my-org-name
37
+
38
+ # Rename all repos owned by a user
39
+ github-default-branch --pat <token> --user my-user
32
40
```
33
41
34
42
Run with the ` --verbose ` flag to see debug information
@@ -41,12 +49,6 @@ Run with the `--verbose` flag to see debug information
41
49
| --repo <name > | The repo to update (format: user/repo) | N/A |
42
50
| --user <name > | Update all repos owned by the provided user (example: my-user) | N/A |
43
51
| --org <name > | Update all repos in the provided org (example: my-org-name) | N/A |
44
- | --keep-old | | false |
52
+ | --keep-old | Keep the old branch rather than deleting it | false |
45
53
| --old | The name of the branch to rename | master |
46
54
| --new | The new branch name | main |
47
-
48
- ## Enhancements
49
-
50
- - Error if the target branch already exists
51
- - ` --visibility ` flag (` all ` , ` public ` , ` private ` ). Default ` all `
52
- - Copy branch protections from the old branch to the new one
0 commit comments