브랜치 생성

git branch 브랜치명

 

브랜치 확인

git branch

 

브랜치 전환

git checkout 브랜치명

 

원격 저장소 연결 확인

git remote -v

 

원격 저장소에 branch 올리기

git push origin 브랜치명

 

브랜치 삭제

git branch -d 브랜치명

 

브랜치 삭제 에러

error: The branch 'feature/docs' is not fully merged. If you are sure you want to delete it, run 'git branch -D feature/docs'.

해당 에러는 브랜치가 merge 되기 전에 삭제될 수 없다는 것이니 원격에 push가 됐다면 아래 명령어로 삭제해준다.

git branch -D 브랜치명

 

특정 브랜치 clone

git clone -b 브랜치명 --single-branch 저장소URL

 

특정 브랜치 pull

git pull origin 브랜치명

 

모든 작업 취소

git reset --hard

 

특정 파일 작업 취소

git checkout -- 파일명.확장자