change default branch git code example

Example 1: change git default branch

git config --global init.defaultBranch <defaultBranchName>

Example 2: change default branch github

On GitHub, navigate to the main page of the repository.
Under your repository name, click Settings.
In the left menu, click Branches.
Under "Default branch", to the right of the default branch name, click .
Use the drop-down, then click a branch name.
Click Update.

Example 3: change branch git

git checkout <branch_name>

Example 4: git change branch

$ git branch iss53
$ git checkout iss53

Tags:

Misc Example