10월 이전의 설치한 git version에 대하여 git init을 통해 git 저장소를 생성하면 처음 default branch는 master로 된다.
git config command를 사용하는 것이다.
git config --global init.defaultBranch main
이후로 git init을 통해 로컬에서 생성하는 repo의 default branch는 main으로 생성된다.
remote repo의 default branch는 setting → branches → default branch에서 변경할 수 있다.
기존의 master branch를 쓰는 로컬 저장소를 main으로 변경해보자. git config --global init.defaultBranch main
을 했어도 이전의 생성된 repo는 default branch가 master로 되어있을 것이다.
git config init.defaultBranch
// master
git config init.defaultBranch main
git branch -m master main