简体   繁体   中英

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

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 在此处输入图片说明

Image 2

在此处输入图片说明

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM