🐈‍⬛ 깃 : Git

git init 이후 hint 메시지와 master 브랜치가 자동 생성될때

예옹이 2025. 3. 20. 16:37

로컬 폴더에 git init를 해주었는데

git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint:     git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:     git branch -m <name>
Initialized empty Git repository in /Users/XXXX/XXXXX/.git/

이러한 메시지가 뜨면서 폴더의 branchmaster로 자동 생성되더라고요

master가 아닌 main 브랜치로 변경해주시면 됩니다.

git config --global init.defaultBranch main

명령어를 치시고 터미널을 나갔다 들어오면 main 브랜치가 적용된걸 확인하실 수 있습니다.

 

+)

만약 확인이 안되시면

로컬 폴더의 .git 폴더를 지우셨다가 git init를 다시 해보세요!