Error with BFG Tool: Multiple File Attributes Causing Conversion Error
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The BFG tool is frequently used to clean up and alter the history of Git repositories. However, an issue arises when multiple file attributes are converted using the tool. During the Git LFS clone process, the multiple file extensions are being copied into one line instead of separate lines. This causes the LFS files not to be automatically pulled.
Multiple File Attributes to Conversion Error with BFG Tool
Environment
Production
Diagnosis
The issue can be diagnosed by examining the .gitattributes file in the Git repository. If there are multiple file extensions listed in a single line, then the issue is confirmed. To address this, the .gitattributes file must contain a separate line for each file extension, with the proper LFS configuration. This will allow the Git LFS system to identify and pull the corresponding LFS files smoothly.
Cause
The issue is caused by the improper formatting of multiple file attributes during the BFG tool conversion process. When the file extensions are joined together in a single line, it makes it difficult for the Git LFS system to identify and retrieve the corresponding LFS files.
1
*.{ext1,ext2,ext3,…} filter=lfs diff=lfs merge=lfs –text
Solution
To address the issue, separate the file extensions into individual lines within the .gitattributes file. By doing this, the Git LFS system will be able to correctly recognize and retrieve the corresponding LFS files during the cloning process.
1
2
3
*.ext1 filter=lfs diff=lfs merge=lfs –text
*.ext2 filter=lfs diff=lfs merge=lfs –text
*.ext3 filter=lfs diff=lfs merge=lfs –text
Was this helpful?