Problem
After updating the IDE, for all projects, the Branches widget shows the Git: Detached HEAD state.
The following exception is shown in the idea.log:
2024-12-12 13:36:33,010 [12638504] WARN - #git4idea.repo.GitRepositoryReader - unknown option `no-color'
usage: git for-each-ref [options] [<pattern>]
-s, --shell quote placeholders suitably for shells
-p, --perl quote placeholders suitably for perl
--python quote placeholders suitably for python
--tcl quote placeholders suitably for tcl
--count <n> show only <n> matched refs
--format <format> format to use for the output
--sort <key> field name to sort on
com.intellij.openapi.vcs.VcsException: unknown option `no-color'
usage: git for-each-ref [options] [<pattern>]
-s, --shell quote placeholders suitably for shells
-p, --perl quote placeholders suitably for perl
--python quote placeholders suitably for python
--tcl quote placeholders suitably for tcl
--count <n> show only <n> matched refs
--format <format> format to use for the output
--sort <key> field name to sort on
at git4idea.commands.GitCommandResult.throwOnError(GitCommandResult.java:172)
at git4idea.repo.GitRepositoryReader.readBranchesFromGit(GitRepositoryReader.kt:240)
at git4idea.repo.GitRepositoryReader.readState(GitRepositoryReader.kt:49)
at git4idea.repo.GitRepositoryImpl.readRepoInfo(GitRepositoryImpl.kt:174)
at git4idea.repo.GitRepositoryImpl.update(GitRepositoryImpl.kt:161)
at git4idea.status.GitChangesCollector.getHead(GitChangesCollector.java:229)
at git4idea.status.GitChangesCollector.collect(GitChangesCollector.java:53)
at git4idea.status.GitChangeProvider.getChanges(GitChangeProvider.java:86)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.actualUpdate(ChangeListManagerImpl.java:726)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.iterateScopes(ChangeListManagerImpl.java:639)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.lambda$updateImmediately$12(ChangeListManagerImpl.java:544)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:674)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:749)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:705)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:673)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.lambda$updateImmediately$15(ChangeListManagerImpl.java:543)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$runUnderDisposeAwareIndicator$13(BackgroundTaskUtil.java:342)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$runUnderDisposeAwareIndicator$15(BackgroundTaskUtil.java:371)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:223)
at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:45)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:222)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:674)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:749)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:705)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:673)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:203)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:366)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:341)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:333)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.updateImmediately(ChangeListManagerImpl.java:493)
at com.intellij.openapi.vcs.changes.UpdateRequestsQueue$RefreshRunnable.run(UpdateRequestsQueue.java:278)
at com.intellij.openapi.vcs.changes.ChangeListScheduler$schedule$future$1.invokeSuspend$lambda$0(ChangeListScheduler.kt:29)
at com.intellij.openapi.progress.CoroutinesKt.blockingContextInner(coroutines.kt:341)
at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invokeSuspend(coroutines.kt:233)
at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt)
at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:232)
at com.intellij.openapi.vcs.changes.ChangeListScheduler$schedule$future$1.invokeSuspend(ChangeListScheduler.kt:28)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
Cause
The Git plugin in the recent IDE versions has some new features that rely on a more recent git version. For example, showing git Tags in the Branches UI. In case that user's installed Git version is pretty old, it could cause such issue.
Resolution
Update the version of the Git installation referenced in Settings (⌘ + , or Ctrl + Alt + S) > Version Control > Git > Path to Git executable to the latest one.
Comments
0 comments
Please sign in to leave a comment.