使用不推荐使用的变量的git分支的最新版本

时间:2019-07-03 10:45:33

标签: git github

我需要安装使用不推荐使用的变量的程序的最新分支。我该怎么办?

我尝试使用

> Task :app:checkDebugDuplicateClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat found in modules classes.jar (com.android.support:support-compat:28.0.0) and support-v4-19.0.1.jar (com.android.support:support-v4:19.0.1)
  Duplicate class android.support.v4.app.ActionBarDrawerToggle found in modules classes.jar (com.android.support:support-core-ui:28.0.0) and support-v4-19.0.1.jar (com.android.support:support-v4:19.0.1)
  Duplicate class android.support.v4.app.ActionBarDrawerToggle$Delegate found in modules classes.jar (com.android.support:support-core-ui:28.0.0) and support-v4-19.0.1.jar (com.android.support:support-v4:19.0.1)
  Duplicate class android.support.v4.app.ActionBarDrawerToggle$DelegateProvider found in modules classes.jar (com.android.support:support-core-ui:28.0.0) and support-v4-19.0.1.jar (com.android.support:support-v4:19.0.1)
  Duplicate class android.support.v4.app.ActionBarDrawerToggle$SlideDrawable found in modules classes.jar (com.android.support:support-core-ui:28.0.0) and support-v4-19.0.1.jar (com.android.support:support-v4:19.0.1)
  Duplicate class android.support.v4.app.ActivityCompat found in modules classes.jar (com.android.support:support-compat:28.0.0) and support-v4-19.0.1.jar (com.android.support:support-v4:19.0.1)

但是它1)仅输出提交哈希值,而2)没有给出最后一个分支。

1 个答案:

答案 0 :(得分:3)

尝试

git grep <variable>  $(git for-each-ref refs/heads refs/remotes/origin --format="%(refname)")

git for-each-ref命令返回分支(由refs/heads)和远程分支(由refs/remotes/origin)。 git grep尝试从这些分支的顶端找到关键字。