🥨 커밋은 할 때 마다 가장 최신 커밋ID가 생성 되고 branch도 생성할 때 마다 브랜치명, 커밋 지점이 달라짐.
👉 tag는 이런 커밋에 이름표를 만들어 붙이는 것임!
ssnhh@DESKTOP-9APISNT MINGW64 ~/git/forGit (main)
$ git log
commit f0bb4a72a9799720dae86aeb9144ab22e6b56278 (HEAD -> main)
Merge: 8ab1175 d277107
Author: ssnhhyejin <ssnhhyejin@gmail.com>
Date: Mon Feb 27 14:59:03 2023 +0900
fix the conflict
commit 8ab1175562963245e883a025af8541b727e5bb24
Author: ssnhhyejin <ssnhhyejin@gmail.com>
Date: Fri Feb 24 19:30:00 2023 +0900
modify-s1-funcb
commit d277107d28e7509df31e5651deb2db1d06282c67 (test)
Author: ssnhhyejin <ssnhhyejin@gmail.com>
Date: Fri Feb 24 19:29:04 2023 +0900
modified-s1-funcb
commit 5904b3e818ffc15a18e334267efcf507c6a56ef8
Author: ssnhhyejin <ssnhhyejin@gmail.com>
Date: Fri Feb 24 19:26:21 2023 +0900
modified-s1
✅ 커밋ID
1) commit f0bb4a72a9799720dae86aeb9144ab22e6b56278
➡ 로그 내 커밋 옆에 적혀있는 게 커밋ID다!
➡ 별도의 커밋ID에 따로 tag명을 붙인게 아니라면 가장 최근 커밋 시점(HEAD➡main)에 tag가 생성 된다
🍕 별도로 커밋 별 tag를 붙이고 싶다 면
➡ git tag 태그명 커밋ID
🥞 tag에 설명을 덧붙이고 싶다면?
➡ git tag -a 태그명 -m 메세지
✅로그 확인
ssnhh@DESKTOP-9APISNT MINGW64 ~/git/forGit (main)
$ git tag 1.0.0
ssnhh@DESKTOP-9APISNT MINGW64 ~/git/forGit (main)
$ git log
commit f0bb4a72a9799720dae86aeb9144ab22e6b56278 (HEAD -> main, tag: 1.0.0)
Merge: 8ab1175 d277107
Author: ssnhhyejin <ssnhhyejin@gmail.com>
Date: Mon Feb 27 14:59:03 2023 +0900
fix the conflict
➕ 🌟 tag를 삭제하고 싶다면?
➡ git tag -d 태그명
✨ tag도 github에 업로드 가능하다!
ssnhh@DESKTOP-9APISNT MINGW64 ~/git/forGit (main)
$ git tag -d test
Deleted tag 'test' (was 8ab1175)
ssnhh@DESKTOP-9APISNT MINGW64 ~/git/forGit (main)
$ git push origin main
Enumerating objects: 32, done.
Counting objects: 100% (32/32), done.
Delta compression using up to 8 threads
Compressing objects: 100% (22/22), done.
Writing objects: 100% (30/30), 2.28 KiB | 466.00 KiB/s, done.
Total 30 (delta 9), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (9/9), done.
To github.com:ssnhhyejin/for_branch.git
507d420..f0bb4a7 main -> main
ssnhh@DESKTOP-9APISNT MINGW64 ~/git/forGit (main)
$ git push --tags
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:ssnhhyejin/for_branch.git
* [new tag] 0d -> 0d
* [new tag] 1.0.0 -> 1.0.0
🧀 git push origin main
🍤 git push --tags