Branch 조회

git branch
git branch -r
git branch -a
- local과 remote의 branch를 모두 조회
Branch 생성, 이동(local)

git branch branch_name
- 로컬에 branch_name 이라는 이름의 branch를 현 위치에서 생성
git checkout branch_name
- 로컬에 branch_name이라는 이름의 branch로 이동
git checkout -b branch_name
- 로컬에 branch_name이라는 이름의 branch가 없으면 새로 생성하고 이동까지 실행
- 로컬에 branch_name이라는 이름의 branch가 있으면 에러
Branch 생성(remote)

git push origin branch_name
- remote repository에 local에서 만든 branch를 생성
Branch 삭제(local)

git branch -d branch_name
- 삭제하려는 branch에 위치하지 않아야 삭제가 가능
- git checkout other_branch_name(다른 branch로 이동) 후 삭제하기
Branch 삭제(remote)

git push origin --delete branch_name