Change:
I would have expected that the command creates a repository with a branch 'main'. I was using the latest insider: This is the repository created using 'Publish to Github'
Related to
In this particular scenario we should honor the default branch setting on GitHub rather than the VS Code setting.

Discussion:
import { Model } from '../model'; import { Repository as BaseRepository, Resource } from '../repository'; <del> import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, ForcePushMode, Ref, Submodule, Commit, Change, RepositoryUIState, Status, LogOptions, APIState, CommitOptions, RefType, CredentialsProvider, BranchQuery, PushErrorHandler, PublishEvent, FetchOptions, RemoteSourceProvider, RemoteSourcePublisher, PostCommitCommandsProvider, RefQuery, BranchProtectionProvider } from './git'; </del> <ins> import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, ForcePushMode, Ref, Submodule, Commit, Change, RepositoryUIState, Status, LogOptions, APIState, CommitOptions, RefType, CredentialsProvider, BranchQuery, PushErrorHandler, PublishEvent, FetchOptions, RemoteSourceProvider, RemoteSourcePublisher, PostCommitCommandsProvider, RefQuery, BranchProtectionProvider, InitOptions } from './git'; </ins> import { Event, SourceControlInputBox, Uri, SourceControl, Disposable, commands, CancellationToken } from 'vscode'; import { combinedDisposable, mapEvent } from '../util'; import { toGitUri } from '../uri';

return result ? new ApiRepository(result) : null; } <del> async init(root: Uri): Promise<Repository | null> { </del> <ins> async init(root: Uri, options?: InitOptions): Promise<Repository | null> { </ins> const path = root.fsPath; <del> await this._model.git.init(path); </del> <ins> await this._model.git.init(path, options); </ins> await this._model.openRepository(path); return this.getRepository(root) || null; }

depth?: number; } <ins> export interface InitOptions { defaultBranch?: string; } </ins> export interface RefQuery { readonly contains?: string; readonly count?: number;

import { assign, groupBy, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent, splitInChunks, Limiter, Versions, isWindows, pathEquals } from './util'; import { CancellationError, CancellationToken, ConfigurationChangeEvent, LogOutputChannel, Progress, Uri, workspace } from 'vscode'; import { detectEncoding } from './encoding'; <del> import { Ref, RefType, Branch, Remote, ForcePushMode, GitErrorCodes, LogOptions, Change, Status, CommitOptions, RefQuery } from './api/git'; </del> <ins> import { Ref, RefType, Branch, Remote, ForcePushMode, GitErrorCodes, LogOptions, Change, Status, CommitOptions, RefQuery, InitOptions } from './api/git'; </ins> import * as byline from 'byline'; import { StringDecoder } from 'string_decoder';

return new Repository(this, repository, dotGit, logger); } <del> async init(repository: string, options: { defaultBranch?: string } = {}): Promise<void> { </del> <ins> async init(repository: string, options: InitOptions = {}): Promise<void> { </ins> const args = ['init']; if (options.defaultBranch && options.defaultBranch !== '') {

progress.report({ message: vscode.l10n.t('Creating first commit'), increment: 25 }); if (!repository) { <del> repository = await gitAPI.init(folder) || undefined; </del> <ins> repository = await gitAPI.init(folder, { defaultBranch: createdGithubRepository.default_branch }) || undefined; </ins> if (!repository) { return;

depth?: number; } <ins> export interface InitOptions { defaultBranch?: string; } </ins> export interface BranchQuery { readonly remote?: boolean; readonly pattern?: string;

toGitUri(uri: Uri, ref: string): Uri; getRepository(uri: Uri): Repository | null; <del> init(root: Uri): Promise<Repository | null>; </del> <ins> init(root: Uri, options?: InitOptions): Promise<Repository | null>; </ins> openRepository(root: Uri): Promise<Repository | null> registerRemoteSourcePublisher(publisher: RemoteSourcePublisher): Disposable;