Re: Rename default branch to 'main' in Fabric repositories


Jay Guo
 

Hi Dave, some minor questions here:

1. will outstanding PRs be automatically updated to re-target main?
2. will visits to master branch be redirected automatically to main? (I suppose github should support this via renaming feature?)
3. If the answer to 2 is yes, then I suppose other projects that pull Fabric master during CI should not be affected?

Thanks!

On Tue, Mar 16, 2021 at 1:52 AM David Enyeart <enyeart@...> wrote:

Based on industry and Hyperledger recommendations, we will be switching default branch from 'master' to 'main' on all Fabric repositories.

I plan to switch all Fabric repositories on Friday March 19th. Doing them all the same day will limit any temporary link breakages across the repositories and docs. Everything should be in working order by Monday.

A few of the repositories have been done already. I've tested the process on Fabric CA repository since it follows similar CI and doc approach as Fabric.

Here is the process that I will be following for each repository:
- Use the new Github feature to rename default branch. This automatically re-targets PRs to "main" and updates branch protections rules.
- PR to update master references in CI pipelines, docs, etc
- Update default branch in Azure Pipelines

Once it is done for a repository, each developer that has a local fork will need to perform the following steps to update their local environment, push the main branch to their fork and associate with local main branch, and ensure local main is rebased on the upstream main branch:
git checkout master
git branch -m master main
git fetch origin
git push origin main
git branch -u origin/main main
git fetch upstream
git rebase upstream/main

The steps assume you are following the Github fork and upstream remote instructions here:
https://hyperledger-fabric.readthedocs.io/en/latest/github/github.html

Please let us know if you have any other suggestions or comments.


Thank you,

Dave Enyeart

Join fabric@lists.hyperledger.org to automatically receive all group messages.