0
0
Gitdevops~5 mins

Tagging specific commits in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Git tag?
A Git tag is a label that points to a specific commit. It helps mark important points like releases or versions in the project history.
Click to reveal answer
beginner
How do you create a lightweight tag on a specific commit?
Use the command git tag <tagname> <commit-hash>. This creates a simple tag pointing to that commit without extra information.
Click to reveal answer
intermediate
What is the difference between lightweight and annotated tags in Git?
Lightweight tags are simple pointers to commits. Annotated tags store extra info like tagger name, date, and message, and are stored as full objects in Git.
Click to reveal answer
intermediate
How do you create an annotated tag on a specific commit?
Use git tag -a <tagname> <commit-hash> -m "message". This adds a message and extra info to the tag.
Click to reveal answer
beginner
How can you push a specific tag to a remote repository?
Use git push origin <tagname> to send the tag to the remote repository so others can see it.
Click to reveal answer
Which command creates a lightweight tag on commit abc123?
Agit commit -m "tag v1.0"
Bgit tag -a v1.0 abc123 -m "version 1.0"
Cgit tag v1.0 abc123
Dgit push origin v1.0
What extra information does an annotated tag include?
ACommit hash only
BBranch name
CRemote URL
DTagger name, date, and message
How do you push all tags to the remote repository?
Agit push origin --tags
Bgit push origin master
Cgit push origin HEAD
Dgit tag push
Which command creates an annotated tag with a message?
Agit tag v1.0
Bgit tag -a v1.0 -m "release"
Cgit tag -d v1.0
Dgit push origin v1.0
If you want to tag a commit but don’t remember its hash, what can you do?
AUse git log to find the commit hash
BUse git push
CUse git branch
DUse git clone
Explain how to create and push an annotated tag on a specific commit in Git.
Think about tagging with extra info and sharing it with others.
You got /4 concepts.
    Describe the difference between lightweight and annotated tags and when you might use each.
    Consider the detail and purpose of the tag.
    You got /4 concepts.