[Git] Remote branch 삭제하기

김뀨뀨·2022년 7월 18일
0

Git

목록 보기
1/1

github에서 remote branch를 삭제했을 때

local에서 삭제된 것이 적용이 안된다.

git fetch --all --prune

또는

git remote prune origin

을 하면 동기화 된다.

local에서 remote branch를 삭제할 때

1. local branch 삭제

git branch -d <branch name>

-d 대신 -D는 --force 옵션이 추가된다.

2. remote branch 삭제

git push -d <remote_name> <branch_name>

+) --dry-run 추가시 실행 없이 결과만 볼 수 있음!

참고: https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely

profile
개발로 밥벌이 하고 싶은 사람

0개의 댓글