[英]How can I compare two commit in different branches with Git in Android Studio 4.1?
I use Git in Android Studio 4.1.我在 Android Studio 4.1 中使用 Git。 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.第一次提交名为“TestC 47”,位于“TestC”分支中,第二次提交名为“Dell_Merge 25”,位于“master”分支中。
I hope to know what are different between "TestC 47" commit and "Dell_Merge 25" commit, how can I do?我希望知道“TestC 47”提交和“Dell_Merge 25”提交有什么不同,我该怎么办?
Image 2图 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 )如果这些提交代表其分支的各自 HEAD,您可以简单地比较分支,如本文所述(来自Minh Pham 的“ How to Use Git in Android Studio ”)
Suppose I'm in the feature branch, and I want to compare it with the master branch.假设我在 feature 分支,我想和 master 分支进行比较。 Go to “VSC” -> “Git” -> “Branches”, select the master branch and choose “Compare with current”.转到“VSC”->“Git”->“分支”,选择主分支并选择“与当前比较”。
A popup “Compare feature with master” shows up with all the differences between the two branches, commits to commits, files to files.一个弹出窗口“Compare feature with master”显示了两个分支之间的所有差异,提交到提交,文件到文件。
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.同样的想法适用于两个任意提交:您可以创建两个临时分支 tmp1 和 tmp2,并如上所述比较这两个分支。
Android Studio 4.1 (Aug. 2020) is based on IntelliJ IDEA 2020-1 , so you can also follow the compare branches illustrated here . Android Studio 4.1 (2020 年 8 月)基于IntelliJ IDEA 2020-1 ,因此您也可以按照此处所示的比较分支进行操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.