본문 바로가기

리눅스

[GIT] 깃 태그(git tag) 생성, 삭제

반응형

깃 태그(git tag) 생성, 삭제

태그 생성 방법

- Lightweight 태그

git tag v1.1.1

$ git tag v1.1.1

$ git show v1.1.1
commit e178f0c017bfba73cdc35c08b532d3cbf608c494 (HEAD -> development, tag: v1.1.1, origin/testing, origin/development)
Author: sangchul <sangchul@gmail.com>
Date:   Wed Jan 27 10:42:15 2021 +0900

    branch 추가

diff --git a/README.md b/README.md
index e69de29..38f8e88 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1 @@
+dev
diff --git a/README2.md b/README2.md
deleted file mode 100644
index 28a0709..0000000
--- a/README2.md
+++ /dev/null
@@ -1 +0,0 @@
-README2.md
(END)

- Annotated 태그(-a 옵션)

git tag -a v1.1.2 -m "Release version 1.1.2"

$ git tag -a v1.1.2 -m "Release version 1.1.2"

$ git show v1.1.2
tag v1.1.2
Tagger: sangchul <sangchul@gmail.com>
Date:   Wed Jan 27 11:56:00 2021 +0900

Release version 1.1.2

commit e178f0c017bfba73cdc35c08b532d3cbf608c494 (HEAD -> development, tag: v1.1.2, tag: v1.1.1, origin/testing, origin/development)
Author: sangchul <sangchul@gmail.com>
Date:   Wed Jan 27 10:42:15 2021 +0900

    branch 추가

diff --git a/README.md b/README.md
index e69de29..38f8e88 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1 @@
+dev
diff --git a/README2.md b/README2.md
deleted file mode 100644
index 28a0709..0000000
--- a/README2.md
+++ /dev/null
@@ -1 +0,0 @@
-README2.md
(END)

태그 확인

git tag

$ git tag
---
v1.0.0
v1.1.1
v1.1.2
(END)
---

태그 삭제

git tag -d v1.0.0

$ git tag -d v1.0.0
Deleted tag 'v1.0.0' (was 251c9cd)

원격 저장소에 태그 생성

git push origin v1.1.1

$ git push origin v1.1.1
Total 0 (delta 0), reused 0 (delta 0)
To http://gitlab.sangchul.kr/playground.git
 * [new tag]         v1.1.1 -> v1.1.1

원격 저장소에 모두 태그 생성

git push origin --tags

$ git push origin --tags
Enumerating objects: 1, done.
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 171 bytes | 171.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To http://gitlab.sangchul.kr/playground.git
 * [new tag]         v1.1.1 -> v1.1.1
 * [new tag]         v1.1.2 -> v1.1.2

원격 저장소에  있는 태그 삭제

git push origin :v1.1.3

$ git push origin :v1.1.3
To http://sangchul.kr/playground.git
 - [deleted]         v1.1.3

 

 

728x90
반응형