#TIL #git remote 저장소에서 지워진 브랜치를 로컬에 반영

$ git fetch --prune
$ git pull --prune

--prune 옵션을 사용하면 된다.

$ git config --global fetch.prune true

리모트 저장소에서 지워진 branch를 로컬에 유지할 필요가 없다. 쌓여서 문제지. 이제 git fetch, git pull 명령을 입력할 때, 옵션을 안 붙여도 된다.

--prune

Before fetching, remove any remote-tracking references that no longer exist on the remote. [.]

- https://git-scm.com/docs/git-fetch

branch는 ‘나뭇가지’란 뜻도 있으니 ‘가지 치다’란 뜻을 가진 prune을 사용했나 보다. 네이밍 센스 좋다.

참고

Feedback plz <3 @ohyecloudy, ohyecloudy@gmail.com

A Random Post