Why my wsl ubuntu's default git branch is Master?

62 views Asked by At

Whenever I use wsl to make any project and try to add project on git it shows the master as a default branch. But when I use windows to create project it shows main. I want to change the default branch of wsl to main

I have tried chatgpt to solve the problem but it messed me up

1

There are 1 answers

3
Bhaskar13 On

You can change the default branch to be used by GIT with the following command

git config --global init.defaultBranch master

Use the same branch in both WSL and windows.

Additionally, you can also look at your current gitconfig settings using cat ~/.gitconfig

cat ~/.gitconfig
[user]
        name = Your Name
        email = [email protected]
[init]
        defaultBranch = master