[Git]Tag 일괄 삭제

Don's tech blog·2023년 8월 2일

GIT

목록 보기
1/1

Outline

git으로 CI(Continuous Integration:지속적 통합)를 관리하는중 누적된 Tag를 정리하고 관리하고자 이글을 작성함.

Tag 조회

# Tag 전체 조회
$ git tag

# 특정 Tag 조회
$ git tag -l '<태그명>*'

# Tag 정보 조회
$ git show '<태그명>'

Tag 생성

태그 생성

$ git tag <태그명>

Annotated 태그 생성

$ git tag -a <태그명> -m "<메시지>"

Tag 일괄 삭제

Remote

$ git tag -l '<태그명>*' | xargs git push --delete origin

Local

$ git tag -l '<태그명>*' | xargs git tag -f 

Remote에서 태그 가져오는 방법

$ git fetch --tags

Remote 에 tag가 없으면 local tag 삭제

git tag -l | xargs git tag -d && git fetch -t
profile
안녕하세요.

1개의 댓글

comment-user-thumbnail
2023년 8월 2일

감사합니다. 이런 정보를 나눠주셔서 좋아요.

답글 달기