We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Default Branch

We've been using Git's default master branch. Interestingly, GitHub (a website where you can remotely store Git projects) recently changed its default branch from master to main. As a general rule, I recommend using main as your default branch if you work primarily with GitHub, as we will.

How to Rename a Branch

git branch -m oldname newname

Assignment

git config set --global init.defaultBranch main

Git config keys are case-insensitive, so defaultBranch and defaultbranch work the same. Git just prefers lowercase when displaying them.

git branch

You should notice that you're still on master! That's because all you did was change the default branch for new repositories.

Run and submit the CLI tests.