Starting with Git 2.28, you can globally define the default branch:
git config --global init.defaultBranch main
Alternatively, you can edit the global .gitconfig file and add
[init]
defaultBranch = main
The next time you initialize a local repository, it looks like this
β swiss-meetup-2021-jan git init
Initialized empty Git repository in /Users/mfriedrich/dev/work/gitlab-de/swiss-meetup-2021-jan/.git/
β swiss-meetup-2021-jan git:(main) β
Next, add & commit any changes and configure the remote origin.
git remote add origin https://gitlab.com/gitlab-de/swiss-meetup-2021-jan.git
git push -u origin main
Push the remote branch. It may be needed to update the local-remote tracking with "-u".