
새로운 test가지 생성하기
1. git status → 가지가 깨끗한지 확인
git status // 깨끗한 상태로 됐는지 확인 // 브랜치로 이동할때 커밋하고 가야 됨커밋하고 깨끗한 상태로 만들기

2. test 가지 생성
2. git branch test // test 가지 생성

3. 가지 확인하기
git branch // 가지 확인하기

별이 마스터에 있으면 지금 있는 위치!
4. 브랜치 이동하기(Checkout)
git checkout test // 브랜치 이동할 때 쓰인다. // 가지가 master에서 test로 바꾼 걸 볼 수 있음

브랜치를 이동할때는 꼭 커밋하고 가야함

git checkout master // 테스트 브랜치 보이지 않음

5. test가지에 커밋한 클래스는 test에 들어가야 볼 수 있음
브랜치 생성과 push 명령어
// 브랜치 생성 git branch [브랜치명] // 해당 브랜치 이동 git checkout [브랜치명] // 원하는 브랜치 이동 확인 git branch main // add, 커밋하기 git add . git commit -m "커밋메세지" // 원하는 브랜치로 push git push origin [브랜치명]
// 해당 브랜치 이동과 원하는 브랜치 생성 git checkout -b [브랜치명]


Share article