While there is no general solution for Git, in the case of GitHub we may be able to use this.
Provide lightweight checkout capability for bitbucket to avoid repository clone for multi-branch pipeline jobs
Optimize Jenkinsfile loading and branch detection
Jesse Glick I don't understand this issue. Currently we are using GitHub API to detect if Jenkinsfile exists in a branch or in a pull request.
Jesse Glick My english failed, I'm sorry. I understand the issue.
This is in progress, correct, Stephen Connolly
moving it to in-progress for you then.