git branch 정렬, 이제 복잡한 스크립트 없이 한 줄로 끝낸다

Sort branches by last commit date

git 브랜치가 많아져 최근 커밋 순으로 정렬하고 싶다면, 더 이상 복잡한 셸 스크립트를 만들 필요가 없다. `git config branch.sort committerdate` 한 줄로 기본 정렬을 지정하거나, `git branch --sort committerdate`로 일회성 정렬을 할 수 있다. 이 글은 저자가 수년간 사용하던 스크립트가 현대 git에서는 불필요함을 발견한 경험을 공유하며, `git-for-each-ref`가 지원하는 다양한 정렬 키(authordate, committerdate, creatordate, taggerdate, contents:size 등)도 소개한다.

현대 git에서는 전혀 불필요하다. `git config branch.sort committerdate`만 설정하면 된다.

이 날의 다른 글

2026-08-30