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

Change the default branch to be main (was: master) #131

Open
jdvorak001 opened this issue Feb 17, 2022 · 5 comments
Open

Change the default branch to be main (was: master) #131

jdvorak001 opened this issue Feb 17, 2022 · 5 comments

Comments

@jdvorak001
Copy link
Collaborator

We should follow the current best practice and change the name of the default branch. The instructions are here.

@jdvorak001
Copy link
Collaborator Author

Don't forget to reconfigure readthedocs.org and our Github Actions.

@ACz-UniBi
Copy link
Member

@jdvorak001 agreed that we rename the branch after the work for v1.1.2 is finalized.

@jdvorak001
Copy link
Collaborator Author

Now when v1.2.0 has been released, we should get down to this.

As a first step, I am deleting https://readthedocs.org/projects/openaire-guidelines-for-cris-managers-development/, which was used in the finalization of v1.2.0.

@jdvorak001
Copy link
Collaborator Author

jdvorak001 commented Jul 6, 2023

Actually, Gitflow looks like a good fit for our needs. Quoting from the document:

Instead of a single main branch, this workflow uses two branches to record the history of the project. The main branch stores the official release history, and the develop branch serves as an integration branch for features. It's also convenient to tag all commits in the main branch with a version number.

In this strategy develop is the default branch, whereas main tracks just the releases.
On readthedocs, develop could be presented as development or draft, whereas main is a good basis for both stable and latest.

@jdvorak001
Copy link
Collaborator Author

The main repository adapted

I have now changed the setup of the main repository. So we do not have master any more, just develop (default) and main. I also deleted stale branches.

ReadTheDocs adapted

I also reconfigured readthedocs: I started the develop version (following the develop branch, one cannot change the name) and changed latest to follow main (only with the default version one can choose a different name).

TODO for developers

Adapt your forks

The easiest way to replicate this new setup in your Github fork of the main repository is to delete it and fork again.

If you don't want to do that, you should do the following (I'm pointing to @ACz-UniBi's fork for the sake of example):

  • Go to the list of branches of your fork
  • Delete all the branches that are not needed any more
  • Add the develop branch:
    • Press the New branch button
    • Type in develop as the new branch name
    • Select openaire:develop as the source for the branch: image
    • Press Create new branch
  • Set develop as the default branch
    • Go to the Settings of your repository
    • In the Default branch section press the button with the two arrows ("Switch to another branch") and select develop: image
    • Press Update and confirm
  • Back on the list of branches add the main branch, setting it to follow openaire:main
  • And finally, delete the master branch

Adapt your local IDE setup

Once again, the simplest approach is to delete your local project and clone it again from your updated fork.

If you do not want to do that, you'll need to do the following:

  • Delete your master branch, both local and remote-tracking
  • Delete your stale branches, both local and remote-tracking
  • Check out develop branch as your new local branch
  • Check out main branch as your new local branch

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