Skip to content

Commit

Permalink
Suppress git warnings about default branch name
Browse files Browse the repository at this point in the history
Suppresses

    hint: Using 'master' as the name for the initial branch. This default branch name
    hint: is subject to change. To configure the initial branch name to use in all
    hint: of your new repositories, which will suppress this warning, call:
    hint:
    hint:   git config --global init.defaultBranch <name>
    hint:
    hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
    hint: 'development'. The just-created branch can be renamed via this command:
    hint:
    hint:   git branch -m <name>

This requires Git 2.28 or newer.
  • Loading branch information
mgedmin committed Oct 22, 2022
1 parent 6f72880 commit e085dca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ class GitHelper(VCSHelper):
command = 'git'

def _init_vcs(self):
self._run('git', 'init')
self._run('git', 'init', '-b', 'main')
self._run('git', 'config', 'user.name', 'Unit Test')
self._run('git', 'config', 'user.email', 'test@example.com')

Expand Down

0 comments on commit e085dca

Please sign in to comment.