github에서는 메인 branch의 이름은 master에서 main으로 변경되었다.
그러나 local git에서 메인 branch명은 그대로 master이다.
이를 main으로 브랜치명을 변경하기 위한 방법을 설명하고자 한다.
1. git init 생성시, default로 main으로 변경하기
git config --global init.defaultBranch main
2.
~/.gitconfig
파일 수정하기위와 동일한 작업이나, 파일을 직접 수정하는 방법이다.
# .gitconfig ... [init] defaultBranch = main ...
3. 이미 생성된 프로젝트의 branch명 변경하기
git branch -m master main