git 명령어 정리

자꾸 까먹는 git 명령어 정리

branch

브랜치 이름 변경

git branch -M main
git brnach -m main

-M 은 대소문자 구별하지 않고, 이미 존재하는 브랜치여도 강제로 변경

commit

커밋 메시지 수정

git commit --amend
git commit --amend -m "수정 메시지"

log

commit의 상태 정보

git log --stat

oneline 그래프

git log --pretty=oneline --graph

checkout

브랜치 생성 + checkout

git checkout -b main2

원격 브랜치에서 지역 브랜치로 가져오기

git checkout -t origin/test/remote-branch