[GRASS-dev] Renaming master branch to main branch

Vaclav Petras wenzeslaus at gmail.com
Sun Aug 22 12:25:43 PDT 2021


Dear all,

The master branch was renamed to main. Please update your local
repositories and workflows accordingly.

## 1. Local repo update and branch rename

If you are contributing code or compiling source code from Git, you need to
modify your local repository as well. Go to your fork's website on GitHub.
It will warn you about the rename in the OSGeo repo. Go to settings and to
the rename. Go to the main page of your fork again. Now it will warn you
about the rename in your repo (your fork). It will give you instructions on
renaming the local branch and making it point to the renamed branch. (The
assumption is that your fork repo is the remote named origin.)

Additionally, there still will be upstream/master and you can remove it
using (assuming upstream remote is the OSGeo repo. You can remove
upstream/master and update info about the default branch using:

git fetch upstream --prune
git remote set-head upstream -a

Alternatively, if you are not keeping your fork's master/main branch up to
date, you can follow instructions from my initial email which allow you to
skip the fork part resulting in a slightly different local setup.

## 2. Updating your contributing steps

To update your local main branch (base branch) and to rebase or merge with
the latest source code, use upstream/main instead of upstream/master.

## 3. Updating workflows using source code from Git

If you have a workflow which is using the source code obtained from Git ,
you will need to update it if you explicitly specify the branch name. If
you do --branch, checkout, or switch, and at the same time using the master
branch, you will need to change "master" to "main". If you use only a
simple `git clone`, no changes are needed because `git clone` takes the
default branch which will continue to work.

## 4. Other issues

The base branch for PRs was changed automatically. The PRs updating most of
the source code for core and addons were merged. Some CI-related changes
will still be needed for core. Additionally, I assume the workflows outside
of the source code will be updated as part of the updates to addons repo
structure and changes for the release branch for 8.0. Help in this area is
welcome.

https://github.com/OSGeo/grass/pull/1806
https://github.com/OSGeo/grass-addons/pull/598

Let me know if you face any questions.

Best,
Vaclav


On Wed, Aug 18, 2021 at 10:41 PM Vaclav Petras <wenzeslaus at gmail.com> wrote:

> Dear all,
>
> I will rename our default branch currently called master to main in the
> following days. We already discussed it here and there, but the rename
> should be relatively smooth. Much simpler than the addons repo
> reorganization. Users not compiling code themselves should not be affected.
> Contributors will be, but GitHub warns you about the rename when you come
> to the repo web page. Those compiling from source may need to make changes.
>
> The update of a local clone can be done with instructions similar to the
> following (I will post them again once I confirm it is the best fit):
>
> git branch -m master main
> git fetch upstream
> git branch -u upstream/main main
> git remote set-head upstream -a
>
> Additionally, to get rid of upstream/master, do:
>
> git fetch --prune
>
> You don't need to update your fork unless you want to.
>
> The changes needed in the repo are already in a PR (feel free to review):
>
> https://github.com/OSGeo/grass/pull/1806
>
> Those compiling from source code obtained from Git will need to make
> changes when they explicitly specify the branch. A simple `git clone` takes
> the default branch which will continue to work. However, if you do
> --branch, checkout, or switch, and at the same time using the master
> branch, you will need to change "master" to "main".
>
> Let me know if you have any questions or concerns.
>
> Best,
> Vaclav
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20210822/720b6588/attachment.html>


More information about the grass-dev mailing list