Skip to content

An RStudio Addin to Help Move the Default Branch of Your GitHub Repos

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

gadenbuie/branchMover

Repository files navigation

branchMover

Change the default branch of your GitHub repositories, from inside RStudio.

Installation

You can install the development version of branchMover from GitHub with:

# install.packages("devtools")
devtools::install_github("gadenbuie/branchMover")

The app uses the usethis and gh packages. You need to configure gh with a Personal Access Token to be able to authenticate with the GitHub API. Read more about setting up a PAT in one of these places:

Then, in RStudio, run the app with:

branchMover::app()

If you’d like to explore or reconfigure the default branch of repositories that you manage in other organizations, provide app() with the user or organization name. Branch Mover will tell you how many repos you have access to in the organization and it won’t let you update branch names for repos where you don’t have admin permissions.

branchMover::app("rstudio-education")
#> ℹ @rstudio-education has 57 total repositories (including forks)
#> • 57 public repos
#> • 0 private repos
#> ℹ 57 non-fork repositories have the following default branches:
#> x master: 51 repos
#> ✓ main: 6 repos
#> ℹ You have admin rights on 1 repo

Notes

branchMover changes the default branch on GitHub and creates an issue announcing the change. If everything works, the issue is closed and instructions on how to update local copies of the repo are added to the issue.

Unfortunately, branchMover doesn’t update the default branch in your local copies of your repos. Thankfully, this is relatively pain-free with the usethis::git_default_branch_rediscover() function, added in usethis version 2.1.2.

The tidyverse article Renaming the default branch by Jenny Bryan provides a lot more detail about what’s going on behind the scenes.

About

An RStudio Addin to Help Move the Default Branch of Your GitHub Repos

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published