What does the git show-ref command do?

What does the git show-ref command do?

a) Lists references (branches or tags) in a Git repository
b) Displays detailed information about a commit
c) Shows the current status of the working directory
d) Displays a summary of the commit history

Answer:

a) Lists references (branches or tags) in a Git repository

Explanation:

The git show-ref command lists references in a Git repository, such as branches or tags. It shows the reference names along with their corresponding commit hashes, making it useful for tracking references to specific commits.

This command helps you see all the reference points (tags, branches) in your repository and their associated commits.

It’s particularly helpful for identifying where different branches or tags point to in the repository history.

Reference:

Top 100 Git and GitHub MCQ Questions and Answers

Scroll to Top