Azure DevOps管道无法检出.sqlfluff等以点开头的文件求助
解决Azure DevOps检出隐藏文件(如.sqlfluff)的问题
方案1:手动执行git检出命令
在现有checkout步骤后添加脚本,强制检出所有文件(包括隐藏文件):
- checkout: self displayName: 'Checkout & Build.Reason: $(Build.Reason) & Build.SourceBranchName: $(Build.SourceBranchName) & System.PullRequest.TargetBranch: $(System.PullRequest.TargetBranch)' persistCredentials: true clean: true fetchDepth: 0 - script: | git checkout HEAD -- . displayName: 'Checkout all files including hidden ones' workingDirectory: $(Build.SourcesDirectory)
方案2:配置git支持隐藏文件
在checkout前设置git配置,确保它能处理隐藏文件:
- script: | git config core.hiddenfiles true displayName: 'Enable git to track hidden files' workingDirectory: $(Build.SourcesDirectory) - checkout: self displayName: 'Checkout & Build.Reason: $(Build.Reason) & Build.SourceBranchName: $(Build.SourceBranchName) & System.PullRequest.TargetBranch: $(System.PullRequest.TargetBranch)' persistCredentials: true clean: true fetchDepth: 0
方案3:检查仓库的.gitignore规则
确认仓库根目录的.gitignore文件中没有包含.sqlfluff或通用隐藏文件的排除规则,如果有,移除对应条目后重新提交仓库。
内容的提问来源于stack exchange,提问作者Aditya Raj
相关产品推荐
相关产品推荐

