[Git] Commands Summary - tag

less than 1 minute read

Commands Summary - tag

git-version-2.29.2

Local

  • Tag 리스트 출력
$ git tag
  • Tag 중 이름이 Test 로 시작하는 것만 출력
$ git tag -l 'Test*'
  • -l: --list


  • 현재 Commit에 Tagging
$ git tag ${TagName}
  • 현재 commit 에 tagging 및 추가정보 입력
    (git show ${TagName} 을 통해 확인가능)
$ git tag ${TagName} -a
$ git tag ${TagName} -am "${TagMessage}"
  • -a: --annotate
  • -m: --message


  • 특정 ${Target} 에 tagging
    Target 은 Commit Hash(HEAD, HEAD^, HEAD~2 사용가능), Branch Name, Tag Name 지정가능
$ git tag ${TagName} ${Target}
  • 특정 ${Target} 에 tagging 및 추가정보 입력
$ git tag ${TagName} ${Target} -a
$ git tag ${TagName} ${Target} -am "${TagMessage}"


  • 특정 tag 제거
$ git tag -d ${TagName}
  • 모든 tag 제거
$ git tag -d $(git tag -l)



Remote

  • Remote tag 리스트 출력
$ git ls-remote --tags
  • Remote 서버에 특정 tag 추가
$ git push origin ${TagName}
  • Remote 서버의 특정 tag 제거
$ git push origin --delete ${TagName}
  • Remote 서버에 Local 의 모든 tag 추가
$ git push origin --tags

Tags: ,

Categories:

Updated:

Leave a comment