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

Rename master branch to main #4383

Closed
gassmoeller opened this issue Oct 26, 2021 · 8 comments
Closed

Rename master branch to main #4383

gassmoeller opened this issue Oct 26, 2021 · 8 comments

Comments

@gassmoeller
Copy link
Member

Most major development platforms (github, gitlab, and bitbucket) have decided to switch their default branch name from master to main to avoid the problematic association of master/slave relationships (see https://github.com/github/renaming/, https://about.gitlab.com/blog/2021/03/10/new-git-default-branch-name/). We discussed this during a developer meeting today and agreed that such a switch would be good for ASPECT as well. A quick search in the repo only found a manageable number of references to the name which could be changed at the same time as the main branch name change. To investigate how smoothly the process will go we decided to let WorldBuilder make the switch first, which is somewhat smaller and more flexible (tracked here: GeodynamicWorldBuilder/WorldBuilder#350). Once WorldBuilder has renamed its default branch we will follow.

@MFraters
Copy link
Member

The renaming in the world builder is completed and it seems to have gone very smooth. I just had to update some documentation and names in tests/benchmarks afterwards, but nothing broke.

@gassmoeller
Copy link
Member Author

Awesome, thanks for the quick test! I followed the change and migrated my own local WorldBuilder clone and github fork as well to see how the process works. Unfortunately there will be some manual work for everyone with one (or many!) aspect clones involved, because commands like git pull upstream master will no longer work (I had hoped that github would forward this to git pull upstream main). On the bright side when you open the webpage of your own fork on github it shows you a nice popup with explanations for how to make the same change in your fork, and then follows up with information for how to rename your local branches, which is great. I would suggest we wait for the next biweekly user meeting to discuss the process and make a plan -- which will likely involve a forum post for everyone and then maybe a few days or a week of a waiting period before actually making the change.

@MFraters
Copy link
Member

Yes, that sounds like a good plan.

One more issue which was encountered by someone was that you have to make sure that you are using the correct remote name. That might sometime be origin, upstream or something else. So it will be hard to give exact instructions, unless they include them looking at git remote -v and letting them find the correct remote. Not impossible, but just a few extra steps.

@bangerth
Copy link
Contributor

It always baffles me to see people use something different than origin and upstream. I think @tjhei might have been one of those people who use a different naming scheme :-)

@tjhei
Copy link
Member

tjhei commented Oct 29, 2021

I avoid the use of origin, yes.

@MFraters
Copy link
Member

Well, I am guilty of that as well :P

The issue for me with origin is that it is the default name based on the repository you cloned it against. Usually that is the main repository, but sometimes that is my own repository. For aspect I usually change the main repository to geodynamics and my own repository to menno. For the world builder that is gwb and menno. That way it is clear to me what is what, or if I am trying to pull from the world builder repository when I am in an aspect directory ;)

@tjhei
Copy link
Member

tjhei commented Feb 14, 2022

We already did this. @gassmoeller can you leave he instructions for what to do locally here in case somebody needs to find it?

@gassmoeller
Copy link
Member Author

Yes, full instructions and a summary can also be found here: https://community.geodynamics.org/t/renaming-aspects-default-branch-to-main/2190

The renaming requires 2 changes from every user of an ASPECT git repository:

  1. Renaming the ‘master’ branch into ‘main’ on your Github fork of ASPECT: You will receive a popup notification on Github the next time you visit your repository with instructions for how to do this. Alternatively instructions are provided here: Renaming a branch - GitHub Docs.
  2. Performing the same change inside every local clone of ASPECT. General instructions are available here: Renaming a branch - GitHub Docs. But specifically, execute the following commands inside your git repository (assuming master is the current name of your default branch, and origin is the remote locations you want to set as the default remote for this branch):
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

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

4 participants