[JENKINS-67860] Git LFS include/exclude filters ignored
Hi,
I'm experiencing some inconsistent behaviours with the gitlfspull extension and if/how it respects the .lfsconfig include/exclude fetch filters, e.g.:
[lfs]
fetchexclude=dir_to_exclude/**/*
I'm finding that for normal branches (not filed as PRs) all files configured for LFS storage are smudged after the git lfs pull completes, including those that are explicitly excluded. Whereas, branches filed as PRs do have the contents of the excluded directories correctly unsmudged (the files are just pointers).
Originally reported by robruckob, imported from: Git LFS include/exclude filters ignored
- status: Open
- priority: Major
- component(s): git-plugin
- label(s): git, git-lfs, git-plugin
- resolution: Unresolved
- votes: 0
- watchers: 2
- imported: 2025-12-02
Raw content of original issue
Hi,
I'm experiencing some inconsistent behaviours with the gitlfspull extension and if/how it respects the .lfsconfig include/exclude fetch filters, e.g.:
[lfs] fetchexclude=dir_to_exclude/**/*I'm finding that for normal branches (not filed as PRs) all files configured for LFS storage are smudged after the git lfs pull completes, including those that are explicitly excluded. Whereas, branches filed as PRs do have the contents of the excluded directories correctly unsmudged (the files are just pointers).
environment
Jenkins 2.303.3<br/>
git-lfs 2.13.3<br/>
Multi-branch pipeline<br/>
Build agent Using a docker image of Ubuntu 20.04<br/>
Ant Plugin 1.12<br/>
Badge 1.9<br/>
Build Timeout 1.20<br/>
Build Timestamp Plugin 1.0.3<br/>
Checks API plugin 1.7.2<br/>
Code Coverage API Plugin 2.0.4<br/>
Config File Provider Plugin 3.8.1<br/>
Copy Artifact Plugin 1.46.2<br/>
Credentials Binding Plugin 1.27<br/>
Docker Pipeline 1.26<br/>
Email Extension Plugin 2.84<br/>
Folders Plugin 6.16<br/>
Forensics API Plugin 1.6.0<br/>
Generic Webhook Trigger Plugin 1.77<br/>
GitHub Integration Plugin.3.0<br/>
GitHub Pull Request Coverage Status 2.1.1<br/>
GitHub plugin 1.34.1<br/>
Gradle Plugin 1.37.1<br/>
Groovy Postbuild 2.5<br/>
HTML Publisher plugin 1.27<br/>
InfluxDB Plugin 3.0.2<br/>
Ivy Plugin 2.1<br/>
JUnit Plugin 1.53<br/>
Javadoc Plugin 1.6<br/>
Jenkins Artifactory Plugin 3.13.2<br/>
Jenkins Cobertura Plugin 1.17<br/>
Jenkins Doxygen Plug-in.18<br/>
Jenkins Git plugin 4.10.0 5 <br/>
Jenkins JaCoCo plugin 3.3.0<br/>
Jenkins Jira plugin 3.6 29 <br/>
Jenkins Mailer Plugin 1.34<br/>
Jenkins Mercurial plugin 2.15<br/>
Jenkins Subversion Plug-in 2.15.1<br/>
Jenkins Violation Comments to GitHub Plugin 1.95<br/>
Jenkins Workspace Cleanup Plugin.39<br/>
Lockable Resources plugin 2.12<br/>
Maven Integration plugin 3.15.1<br/>
NodeJS Plugin 1.4.1<br/>
Parameterized Scheduler 1.0<br/>
Pipeline GitHub Notify Step Plugin 1.0.5<br/>
Pipeline Utility Steps 2.10.0<br/>
Pipeline: AWS Steps 1.43<br/>
Pipeline: Basic Steps 2.24<br/>
Pipeline: Build Step 2.15<br/>
Pipeline: Declarative 1.9.2<br/>
Pipeline: GitHub 2.8-138.d766e30bb08b<br/>
Pipeline: Groovy 2633.v6baeedc13805<br/>
Pipeline: Input Step 2.12<br/>
Pipeline: Job 2.42 628 <br/>
Pipeline: Milestone Step 1.3.2<br/>
Pipeline: Multibranch 2.26 3686 <br/>
Pipeline: Nodes and Processes 1097.veac1aacfbda8<br/>
Pipeline: SCM Step 2.13<br/>
Pipeline: Shared Groovy Libraries 548.v9085a486966a<br/>
Pipeline: Stage Step 2.5<br/>
SSH Agent Plugin 1.23<br/>
SSH Pipeline Steps 2.0.0<br/>
Slack Notification Plugin 2.48<br/>
SonarQube Scanner for Jenkins 2.13.1<br/>
Timestamper 1.13<br/>
Token Macro Plugin 267.vcdaea6462991<br/>
Warnings Next Generation Plugin 9.7.0<br/>
xUnit plugin 3.0.5<br/>
AWS Global Configuration Plugin 1.7<br/>
Amazon ECR plugin 1.7<br/>
Amazon Web Services SDK :: All 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: CloudFormation 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: CodeBuild 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: EC2 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: ECR 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: ECS 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: Elastic Beanstalk 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: IAM 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: Logs 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: Minimal 1.12.101-300.vc09c7be9cb57<br/>
Amazon Web Services SDK :: SSM 1.12.101-300.vc09c7be9cb57<br/>
Analysis Model API Plugin 10.6.0<br/>
Artifact Manager on S3 plugin 1.16<br/>
Authentication Tokens API Plugin 1.4<br/>
Autofavorite for Blue Ocean 1.2.4<br/>
Basic Branch Build Strategies Plugin 1.3.2<br/>
Bitbucket Branch Source Plugin 2.9.11<br/>
Bitbucket Pipeline for Blue Ocean 1.25.1<br/>
Blue Ocean 1.25.1<br/>
Blue Ocean Core JS 1.25.1<br/>
Blue Ocean Pipeline Editor 1.25.1<br/>
Bootstrap 4 API Plugin 4.6.0-3<br/>
Bootstrap 5 API Plugin 5.1.3-1<br/>
Branch API Plugin 2.7.0<br/>
Caffeine API Plugin 2.9.2-29.v717aac953ff3<br/>
CloudBees AWS Credentials Plugin 1.32<br/>
CloudBees Disk Usage Simple Plugin.10<br/>
Command Agent Launcher Plugin 1.6<br/>
Common API for Blue Ocean 1.25.1<br/>
Config API for Blue Ocean 1.25.1<br/>
Credentials Plugin 2.6.1<br/>
DEPRECATED Blue Ocean Executor Info 1.25.1<br/>
DTKit 2 API. 3.0.0<br/>
Dashboard for Blue Ocean 1.25.1<br/>
DataTables.net API Plugin 1.11.3-4<br/>
Display URL API 2.3.5<br/>
Display URL for Blue Ocean 2.4.1<br/>
Docker Commons Plugin 1.17<br/>
Durable Task Plugin 493.v195aefbb0ff2<br/>
ECharts API Plugin 5.2.2-1<br/>
Events API for Blue Ocean 1.25.1<br/>
External Monitor Job Type Plugin 1.7<br/>
Favorite 2.3.3<br/>
Font Awesome API Plugin 5.15.4-1<br/>
Git Pipeline for Blue Ocean 1.25.1<br/>
GitHub API Plugin 1.133<br/>
GitHub Branch Source Plugin 2.11.3<br/>
GitHub Pipeline for Blue Ocean 1.25.1<br/>
Google Login Plugin 1.6<br/>
Handy Uri Templates 2.x API Plugin 2.1.8-1.0<br/>
Icon Shim 3.0.0<br/>
Infrastructure plugin for Publish Over X.22<br/>
JAXB plugin 2.3.0.1<br/>
JIRA Integration for Blue Ocean 1.25.1<br/>
JQuery3 API Plugin 3.6.0-2<br/>
JWT for Blue Ocean 1.25.1<br/>
Jackson 2 API Plugin 2.13.0-230.v59243c64b0a5<br/>
Java JSON Web Token (JJWT) Plugin.11.2-9.c8b45b8bb173<br/>
JavaScript GUI Lib: ACE Editor bundle plugin 1.1<br/>
JavaScript GUI Lib: Handlebars bundle plugin 3.0.8<br/>
JavaScript GUI Lib: Moment.js bundle plugin 1.1.1<br/>
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin 1.2.1<br/>
Jenkins Apache HttpComponents Client 4.x API Plugin 4.5.13-1.0<br/>
Jenkins Design Language 1.25.1<br/>
Jenkins Extended Read Permission Plugin 3.2<br/>
Jenkins GIT server Plugin 1.10<br/>
Jenkins Git client plugin 3.10.0<br/>
Jenkins JSch dependency plugin.1.55.2<br/>
Jenkins Pub-Sub "light" Bus 1.16<br/>
Jenkins jQuery UI plugin 1.0.2<br/>
Job and Stage monitoring Plugin 3.6.2<br/>
LDAP Plugin 2.7<br/>
MapDB API Plugin 1.0.9.0<br/>
Matrix Authorization Strategy Plugin 2.6.8<br/>
Matrix Project Plugin 1.19<br/>
Metrics Plugin 4.0.2.8<br/>
OAuth Credentials plugin.5<br/>
OWASP Markup Formatter Plugin 2.4<br/>
OkHttp Plugin 4.9.2-20211102<br/>
Oracle Java SE Development Kit Installer Plugin 1.5<br/>
PAM Authentication plugin 1.6.1<br/>
Personalization for Blue Ocean 1.25.1<br/>
Pipeline 2.6<br/>
Pipeline Graph Analysis Plugin 1.11<br/>
Pipeline SCM API for Blue Ocean 1.25.1<br/>
Pipeline implementation for Blue Ocean 1.25.1<br/>
Pipeline: API 2.47<br/>
Pipeline: Declarative Agent API 1.1.1<br/>
Pipeline: Declarative Extension Points API 1.9.2<br/>
Pipeline: GitHub Groovy Libraries 1.0<br/>
Pipeline: Model API 1.9.2<br/>
Pipeline: REST API Plugin 2.19<br/>
Pipeline: Stage Tags Metadata 1.9.2<br/>
Pipeline: Stage View Plugin 2.19<br/>
Pipeline: Step API 2.24<br/>
Pipeline: Supporting APIs 3.8<br/>
Plain Credentials Plugin 1.7<br/>
Plugin Usage - Plugin 2.0<br/>
Plugin Utilities API Plugin 2.5.1<br/>
Popper.js 2 API Plugin 2.10.2-1<br/>
Popper.js API Plugin 1.16.1-2<br/>
Prometheus metrics plugin 2.0.10<br/>
REST API for Blue Ocean 1.25.1<br/>
REST Implementation for Blue Ocean 1.25.1<br/>
Resource Disposer Plugin.16<br/>
Role-based Authorization Strategy 3.2.0<br/>
Run Condition Plugin 1.5<br/>
SCM API Plugin 2.6.5<br/>
SSH Build Agents plugin 1.33.0<br/>
SSH Credentials Plugin 1.19<br/>
SSH server 3.1.0<br/>
Safe Restart Plugin.3<br/>
Script Security Plugin 1.78<br/>
Server Sent Events (SSE) Gateway Plugin 1.24<br/>
Snakeyaml API Plugin 1.29.1<br/>
Structs Plugin 1.23<br/>
Test Results Analyzer Plugin.3.5<br/>
Trilead API Plugin 1.0.13<br/>
Variant Plugin 1.4<br/>
WMI Windows Agents Plugin 1.8<br/>
Web for Blue Ocean 1.25.1<br/>
bouncycastle API Plugin 2.25<br/>
i18n for Blue Ocean 1.25.1<br/>
jQuery plugin 1.12.4-1
markewaite:
- Original comment link
Raw content of original comment:
The git plugin disables the smudge filter ( GIT_LFS_SKIP_SMUDGE=1 ) and uses an explicit git lfs pull origin to retrieve the large files. There is an attempt to set the LFS fetchinclude and fetchexclude values if sparse checkout is being used, but as far as I can tell, that's the only case where the plugin sets fetchexclude.
The git plugin disables the smudge filter ( GIT_LFS_SKIP_SMUDGE=1 ) and uses an explicit git lfs pull origin to retrieve the large files. There is an attempt to set the LFS fetchinclude and fetchexclude values if sparse checkout is being used, but as far as I can tell, that's the only case where the plugin sets fetchexclude.
robruckob:
- Original comment link
Raw content of original comment:
Thanks for confirming my suspicions markewaite. Will this be considered a bug that will be fixed, or is this is how it is intended to be?
If it's the latter, presumably I'll need to disable the gitlfspull extension, resolve the authentication issue mentioned in https://issues.jenkins.io/browse/JENKINS-62382 and move to doing a manual `git lfs pull` that does respect the lfs filters?
Thanks for confirming my suspicions markewaite. Will this be considered a bug that will be fixed, or is this is how it is intended to be?
If it's the latter, presumably I'll need to disable the gitlfspull extension, resolve the authentication issue mentioned in https://issues.jenkins.io/browse/JENKINS-62382 and move to doing a manual `git lfs pull` that does respect the lfs filters?