How can I compare two commit in different branches with Git in Android Studio 4.1?

Viewed 609

I use Git in Android Studio 4.1. There are two commit in different branches.

The first commit is named "TestC 47" located in "TestC" branch, the second commit is named "Dell_Merge 25" located in "master" branch.

I hope to know what are different between "TestC 47" commit and "Dell_Merge 25" commit, how can I do?

Image 1 enter image description here

Image 2

enter image description here

1 Answers

If those commits represents the respective HEAD of their branch, you can simply compare branch, as described in this article ("How to Use Git in Android Studio" from Minh Pham)

Suppose I’m in the feature branch, and I want to compare it with the master branch. Go to “VSC” -> “Git” -> “Branches”, select the master branch and choose “Compare with current”.

https://miro.medium.com/max/597/1*IwC5W6KLmZngioTbo1dVlQ.png

A popup “Compare feature with master” shows up with all the differences between the two branches, commits to commits, files to files.

https://miro.medium.com/max/955/1*XAT0jg4LK7zPKEvt448Agg.png

The same idea applies for two arbitrary commits: you can create two temporary branches tmp1 and tmp2, and compare those two branches as described above.

Android Studio 4.1 (Aug. 2020) is based on IntelliJ IDEA 2020-1, so you can also follow the compare branches illustrated here.

Related