How to use git log Command In Git
Another way to visualize the differences between branches is by using the git log command with the –left-right option. This option shows which commits are unique to each branch.
To see the commits unique to each branch, use the following command:
git log --oneline --left-right <branch1>...<branch2>
Replace <branch1> and <branch2> with the names of the branches you want to compare.
For example, to see the commits unique to the master and feature branches:
git log --oneline --left-right master...feature
How to See the Differences between two Branches?
When working on a Git repository with multiple branches, it’s essential to compare the changes between different branches to understand the differences and merge them effectively. Git provides several commands to visualize the differences between branches. In this article, we’ll explore how to see the differences between the two branches step by step.
Table of Content
- Using git diff Command
- Using git difftool Command
- Using git log Command
- Using Gitk
- Using External Diff Tools
- Viewing Commit Differences
- Comparing Merged History
- Conclusion