"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: rename master branch to main
To:
gameoftrees@openbsd.org
Date:
Mon, 21 Sep 2020 23:58:46 +0200

Download raw body.

Thread
On Fri, Sep 18, 2020 at 01:16:23PM +0200, Stefan Sperling wrote:
> I would like to rename the 'master' branch to 'main' in the got.git
> and diff.git repositories on git.gameoftrees.org in order to match the
> default used by 'got init'. Note that got-www.git already uses 'main'.

This is now done.

Below are the steps I use to follow the default branch name change
in existing clones of a repository:

$ got fetch
$ got update -b main
$ got rebase master
$ got update -b main
$ got integrate master
$ got branch -d master
$ got branch -d master  # bug workaround: delete it from packed-refs file, too
$ got ref -d refs/remotes/origin/master
$ got ref -s refs/heads/main HEAD

Please let me know if this change is causing any unexpected issues.

> It seems that simply running 'git branch -m' would be enough to switch
> the server's repository over. Once the branch has been renamed with
> that method, Git users will see this:
> 
>  $ git pull
>  [...]
>   * [new branch]        main       -> origin/main
>   Your configuration specifies to merge with the ref 'refs/heads/master'
>   from the remote, but no such ref was fetched.
> 
> And got users will see:
> 
>  $ got fetch
>  [...]
>  Fetched 24959d7c9d8bfb97fa2b67b3eb642bb040515b1d.pack
>  Created reference refs/remotes/origin/main: c8c7d149feda16fa5f471654738791b6e7f1
> af5e
>  Created reference refs/heads/main: c8c7d149feda16fa5f471654738791b6e7f1af5e
>  Created reference refs/remotes/origin/HEAD: refs/remotes/origin/main
> 
> I think in either case it is clear what happened, and what action
> needs to be taken to continue working against the main branch (simply
> run the same commands as usual, using 'main' instead of 'master').
> 
>