diff --git a/plugins/git4idea/src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt b/plugins/git4idea/src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt index 05717d555e1c..d7bfa602b7bc 100644 --- a/plugins/git4idea/src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt +++ b/plugins/git4idea/src/git4idea/remote/hosting/GitRemoteBranchesUtil.kt @@ -129,7 +129,11 @@ object GitRemoteBranchesUtil { withRawProgressReporter { withContext(Dispatchers.Default) { coroutineToIndicator { - GitFetchSupport.fetchSupport(repository.project).fetch(repository, branch.remote, branch.nameForRemoteOperations) + val refspec = when (branch) { + is GitSpecialRefRemoteBranch -> "${branch.nameForRemoteOperations}:${branch.nameForLocalOperations}" + else -> branch.nameForRemoteOperations + } + GitFetchSupport.fetchSupport(repository.project).fetch(repository, branch.remote, refspec) } } }