Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOTICE: upcoming default branch name change #274

Open
2 of 5 tasks
jesse-ross opened this issue Jan 19, 2022 · 1 comment
Open
2 of 5 tasks

NOTICE: upcoming default branch name change #274

jesse-ross opened this issue Jan 19, 2022 · 1 comment

Comments

@jesse-ross
Copy link

jesse-ross commented Jan 19, 2022

The master branch of this repository will soon be renamed from master to main, as part of a coordinated change across the USGS-R and USGS-VIZLAB organizations. This is part of a broader effort across the git community to use more inclusive language. For instance, git, GitHub, and GitLab have all changed or are in the process of changing their default branch name.

We will make this change early in the week of February 6, 2022. The purpose of this issue is to give notification of the change and provide information on how to make it go smoothly.

If you wish to make the change yourself rather than wait for us to do it, it can either be done manually or through some convenience functions in the usethis package.

  • From your local version of the repository, change the remote branch name using either of the methods detailed below: usethis or the manual method.
  • Verify that the local branches are changed as well (if using usethis) or change them yourselves (if using the manual method).
  • If you have collaborators on this repository, let them know that they will need to change their forked/local repos either by running usethis::git_default_branch_rediscover() or by steps 2 and 3 of the manual method. Point them to this issue to facilitate the process!
  • Search within your repository for "master" so that you can change references (e.g. URLs pointing to specific commit points of files) to point to "main" instead.
  • When you are done, feel free to close this issue!

Using usethis

Note: usethis must be version 2.1.2 or higher

  1. Navigate to your project's working directory.
  2. Double-check that you have git credentials set up for HTTPS by running usethis::gh_token_help(). If you have not yet set up git credentials for HTTPS, you can do so by creating a GitHub PAT and using gitcreds::gitcreds_set() to register it with git. The PAT must have at least "repo" scope. gitcreds_gitcreds_set
  3. Rename default branches locally and on all remote repositories at once with usethis::git_default_branch_rename(). For more details see here.
  4. Verify that the work was successful by running usethis::git_default_branch().

Manual Method

  1. Go to <your repository> -> Settings -> Branches and edit the default branch from master to main.
  2. All members should update their local settings so that new repositories created locally will have the correct default branch: git config --global init.defaultBranch main.
  3. All members must update their local settings to match the change to this repository. They can either do this with usethis::git_default_branch_rediscover() (see above) or else run the following:
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
@jordansread
Copy link
Member

renaming done, but haven't searched for uses or notified others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants