How do you view the commit history of a repository in a graph format?

How do you view the commit history of a repository in a graph format?

a) git log --graph
b) git graph
c) git log --history
d) git show --graph

Answer:

a) git log --graph

Explanation:

The git log --graph command displays the commit history in a graphical representation, showing branch structures and merges. It helps visualize the relationships between commits and branches.

This command is useful for reviewing the project’s commit history and understanding how branches have diverged and merged over time.

Reference:

Top 100 Git and GitHub MCQ Questions and Answers

Scroll to Top