private static @Nullable GitRepository findRepository(@NotNull Project project, @NotNull VirtualFile excludeFile) {
    String excludeFilePath = excludeFile.getPath();
    for (GitRepository repository : GitRepositoryManager.getInstance(project).getRepositories()) {
      if (repository.getRepositoryFiles().isExclude(excludeFilePath)) {
        return repository;
      }
    }
    return null;
  }
private static @Nullable GitRepository findRepository(@NotNull Project project, @NotNull VirtualFile excludeFile)