void (@NotNull Collection<? extends VcsRef> refs) { cd(getProjectRoot()); for (final VcsRef ref : refs) { if (ref.getType() == GitRefManager.LOCAL_BRANCH) { final String localBranch = ref.getName(); if (ContainerUtil.exists(refs, remoteRef -> remoteRef.getType() == GitRefManager.REMOTE_BRANCH && remoteRef.getName().replace("origin/", "").equals(localBranch))) { git("config branch." + localBranch + ".remote origin"); git("config branch." + localBranch + ".merge refs/heads/" + localBranch); } } } }