1 개요[ | ]
- git 브랜치 삭제
로컬 브랜치 삭제
Bash
Copy
git branch -d 로컬브랜치명
원격 브랜치 삭제
Bash
Copy
git push origin --delete 원격브랜치명
2 실습[ | ]
Console
Copy
# git branch -a | grep new_architecture
new_architecture
remotes/origin/new_architecture
- → 로컬과 원격에 모두 브랜치가 있는 경우...
Console
Copy
# git branch -d new_architecture
warning: deleting branch 'new_architecture' that has been merged to
'refs/remotes/origin/new_architecture', but not yet merged to HEAD.
Deleted branch new_architecture (was cb8c90d).
- → 로컬 브랜치를 삭제하면 원격 브랜치는 남아 있다는 경고가 나온다. 로컬 브랜치는 삭제되었다.
Console
Copy
# git push origin --delete new_architecture
Username for 'https://github.com': testuser01
Password for 'https://testuser01@github.com': P@ssw0rd
To https://github.com/testuser01/my-www.git
- [deleted] new_architecture
- → 원격 브랜치도 삭제되었다.
3 같이 보기[ | ]
- git branch - 로컬 브랜치 목록 조회
- git branch -a - 로컬 및 원격 브랜치 목록 조회
- git push origin
- git 브랜치 생성
- git 브랜치 전환
- git 로컬 브랜치 삭제
- git 원격 브랜치 삭제
4 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.