oh-my-git/levels/tags/add-tag-later
2021-01-05 13:15:05 +01:00

51 lines
729 B
Plaintext

title = Tagging later
cards = checkout commit-auto merge reset-hard
[description]
But what happens if you forgot to tag your current commit?
No Prob! You can also tag older commits via
git tag <tag-name> <commit-hash>
Tag the commit "Adding feature 2" with the name "v1"!
---
tipp1
---
tipp2
---
tipp3
[setup]
echo "event 1" > feature-list
git add .
git commit -m "Adding feature 1"
echo "event 2" >> feature-list
git add .
git commit -m "Adding feature 2"
echo "event 3" >> feature-list
git add .
git commit -m "Adding feature 3"
git checkout --detach main
[win]
# Did you create a new tag?
test "$(git show v1 -s --format=%h)" = "$(git show HEAD~1 -s --format=%h)"
[actions]
[congrats]
Well done :)